Skip to content

Commit

Permalink
Migration to ethers-v6 in progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
steven2308 committed Jan 9, 2024
1 parent 9e783bf commit e70b541
Show file tree
Hide file tree
Showing 52 changed files with 5,244 additions and 9,153 deletions.
9 changes: 4 additions & 5 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as dotenv from 'dotenv';

import { HardhatUserConfig, task } from 'hardhat/config';
import '@nomiclabs/hardhat-etherscan';
import '@nomicfoundation/hardhat-chai-matchers';
import '@typechain/hardhat';
import 'hardhat-gas-reporter';
import 'solidity-coverage';
// import '@nomiclabs/hardhat-etherscan';
import '@nomicfoundation/hardhat-ethers';
// import '@nomicfoundation/hardhat-chai-matchers';
import '@nomicfoundation/hardhat-toolbox';
import 'hardhat-contract-sizer';
import '@primitivefi/hardhat-dodoc';

Expand Down
63 changes: 22 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,30 @@
"node": ">=16.0.0"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.0"
},
"devDependencies": {
"@defi-wonderland/smock": "^2.3.4",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.7",
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-etherscan": "^3.1.3",
"@openzeppelin/test-helpers": "^0.5.16",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.3",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.3",
"@nomiclabs/hardhat-etherscan": "^3.1.8",
"@openzeppelin/contracts": "^5.0.0",
"@primitivefi/hardhat-dodoc": "^0.2.3",
"@typechain/ethers-v5": "^10.1.1",
"@typechain/hardhat": "^6.1.4",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.10",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"chai": "^4.3.6",
"dotenv": "^16.0.3",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"ethers": "^5.7.2",
"hardhat": "^2.17.0",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.8",
"chai": "^4.2.0",
"dotenv": "^16.3.1",
"ethers": "^6.9.2",
"hardhat": "^2.19.4",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "2.8.0",
"prettier-plugin-solidity": "^1.1.3",
"rimraf": "^3.0.2",
"solc": "^0.8.21",
"solhint": "^3.3.7",
"solidity-coverage": "^0.8.4",
"ts-node": "^10.9.1",
"typechain": "^8.1.1",
"typescript": "^4.9.3",
"walk-sync": "^3.0.0"
"solidity-coverage": "^0.8.6-sha1.0",
"squirrelly": "^8.0.8",
"ts-node": "^11.0.0-beta.1",
"typechain": "^8.3.2",
"typescript": "^5.3.3"
},
"resolutions": {
"@solidity-parser/parser": "0.16.0"
}
"devDependencies": {}
}
10 changes: 5 additions & 5 deletions scripts/deploy_bulkWriter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { ethers, run } from 'hardhat';

export const sleep = (ms: number): Promise<void> => {
Expand All @@ -10,16 +10,16 @@ export const sleep = (ms: number): Promise<void> => {
async function main() {
const accounts: SignerWithAddress[] = await ethers.getSigners();
const owner = accounts[0];
console.log('Deployer address: ' + owner.address);
console.log('Deployer address: ' + (await owner.getAddress()));
// We get the contract to deploy
const factory = await ethers.getContractFactory('RMRKBulkWriter');
const bulkwriter = await factory.deploy();
await bulkwriter.deployed();
console.log('RMRK Bulk Writer deployed to:', bulkwriter.address);
await bulkwriter.waitForDeployment();
console.log('RMRK Bulk Writer deployed to:', await bulkwriter.getAddress());
await sleep(1000);

await run('verify:verify', {
address: bulkwriter.address,
address: await bulkwriter.getAddress(),
constructorArguments: [],
});
}
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy_catalogUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function main() {
// // Send eth to this address:0xfbea1b97406c6945d07f50f588e54144ea8b684f
// let tx = {
// to: '0xfbea1b97406c6945d07f50f588e54144ea8b684f',
// value: ethers.utils.parseEther('0.03'),
// value: ethers.parseEther('0.03'),
// nonce: 235,
// };
// const [signer] = await ethers.getSigners();
Expand All @@ -21,12 +21,12 @@ async function main() {

const catalogUtilsFactory = await ethers.getContractFactory('RMRKCatalogUtils');
const catalogUtils = await catalogUtilsFactory.deploy();
await catalogUtils.deployed();
console.log('RMRK Catalog Utils deployed to:', catalogUtils.address);
await catalogUtils.waitForDeployment();
console.log('RMRK Catalog Utils deployed to:', await catalogUtils.getAddress());
await sleep(1000);

await run('verify:verify', {
address: catalogUtils.address,
address: await catalogUtils.getAddress(),
constructorArguments: [],
});
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy_collectionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ async function main() {
// We get the contract to deploy
const collectionUtilsFactory = await ethers.getContractFactory('RMRKCollectionUtils');
const collectionUtils = await collectionUtilsFactory.deploy();
await collectionUtils.deployed();
console.log('RMRK Collection Utils deployed to:', collectionUtils.address);
await collectionUtils.waitForDeployment();
console.log('RMRK Collection Utils deployed to:', await collectionUtils.getAddress());
await sleep(1000);

await run('verify:verify', {
address: collectionUtils.address,
address: await collectionUtils.getAddress(),
constructorArguments: [],
});
}
Expand Down
32 changes: 32 additions & 0 deletions scripts/deploy_emotable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { ethers, run } from 'hardhat';

export const sleep = (ms: number): Promise<void> => {
return new Promise((resolve) => {
setTimeout(() => resolve(), ms);
});
};

async function main() {
const accounts: SignerWithAddress[] = await ethers.getSigners();
const owner = accounts[0];
console.log('Deployer address: ' + (await owner.getAddress()));
// We get the contract to deploy
const emotableRepoFactory = await ethers.getContractFactory('RMRKEmotesRepository');
const emotableRepo = await emotableRepoFactory.deploy();
await emotableRepo.waitForDeployment();
console.log('RMRKEmotesRepository deployed to:', await emotableRepo.getAddress());
await sleep(1000);

await run('verify:verify', {
address: await emotableRepo.getAddress(),
constructorArguments: [],
});
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
10 changes: 5 additions & 5 deletions scripts/deploy_renderUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { ethers, run } from 'hardhat';

export const sleep = (ms: number): Promise<void> => {
Expand All @@ -10,16 +10,16 @@ export const sleep = (ms: number): Promise<void> => {
async function main() {
const accounts: SignerWithAddress[] = await ethers.getSigners();
const owner = accounts[0];
console.log('Deployer address: ' + owner.address);
console.log('Deployer address: ' + (await owner.getAddress()));
// We get the contract to deploy
const renderUtilsFactory = await ethers.getContractFactory('RMRKEquipRenderUtils');
const renderUtils = await renderUtilsFactory.deploy();
await renderUtils.deployed();
console.log('RMRK Equip Render Utils deployed to:', renderUtils.address);
await renderUtils.waitForDeployment();
console.log('RMRK Equip Render Utils deployed to:', await renderUtils.getAddress());
await sleep(1000);

await run('verify:verify', {
address: renderUtils.address,
address: await renderUtils.getAddress(),
constructorArguments: [],
});
}
Expand Down
35 changes: 35 additions & 0 deletions scripts/deploy_royaltiesSplitter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { ethers, run } from 'hardhat';

export const sleep = (ms: number): Promise<void> => {
return new Promise((resolve) => {
setTimeout(() => resolve(), ms);
});
};

async function main() {
const accounts: SignerWithAddress[] = await ethers.getSigners();
const owner = accounts[0];
console.log('Deployer address: ' + (await owner.getAddress()));
// We get the contract to deploy
const royaltiesSplitterFactory = await ethers.getContractFactory('RMRKRoyaltiesSplitter');
const royaltiesSplitter = await royaltiesSplitterFactory.deploy(
['0x147d79f1c9244b85cba959262fb71ad38069febb', '0xacD3d4b7b0706d39e6cA6E8c75dDdD446b8cdB1D'],
[7000, 3000],
);
await royaltiesSplitter.waitForDeployment();
console.log('RMRK Royalties Splitter deployed to:', await royaltiesSplitter.getAddress());
await sleep(10000);

await run('verify:verify', {
address: await royaltiesSplitter.getAddress(),
constructorArguments: [],
});
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
34 changes: 34 additions & 0 deletions scripts/deploy_tokenAttributesRepo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { ethers, run } from 'hardhat';

export const sleep = (ms: number): Promise<void> => {
return new Promise((resolve) => {
setTimeout(() => resolve(), ms);
});
};

async function main() {
const accounts: SignerWithAddress[] = await ethers.getSigners();
const owner = accounts[0];
console.log('Deployer address: ' + (await owner.getAddress()));
// We get the contract to deploy
const tokenAttributesRepoFactory = await ethers.getContractFactory(
'RMRKTokenAttributesRepository',
);
const tokenAttributesRepo = await tokenAttributesRepoFactory.deploy();
await tokenAttributesRepo.waitForDeployment();
console.log('RMRKTokenAttributesRepository deployed to:', await tokenAttributesRepo.getAddress());
await sleep(10000);

await run('verify:verify', {
address: await tokenAttributesRepo.getAddress(),
constructorArguments: [],
});
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
4 changes: 2 additions & 2 deletions test/behavior/catalog.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { Contract } from 'ethers';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers';
import { IOtherInterface, IERC165, IRMRKCatalog } from '../interfaces';

async function shouldBehaveLikeCatalog(contractName: string, metadataURI: string, type: string) {
Expand Down Expand Up @@ -34,7 +34,7 @@ async function shouldBehaveLikeCatalog(contractName: string, metadataURI: string

const Catalog = await ethers.getContractFactory(contractName);
testCatalog = await Catalog.deploy(metadataURI, type);
await testCatalog.deployed();
await testCatalog.waitForDeployment();
});

describe('Init Catalog', async function () {
Expand Down
Loading

0 comments on commit e70b541

Please sign in to comment.