Skip to content

Commit

Permalink
update to ethers v6
Browse files Browse the repository at this point in the history
  • Loading branch information
fhildeb committed Feb 7, 2024
1 parent e76b668 commit b62d6a5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
Binary file modified smart-contracts-hardhat/bun.lockb
Binary file not shown.
4 changes: 3 additions & 1 deletion smart-contracts-hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.4.1",
"dotenv": "^16.3.1",
"hardhat": "^2.17.2",
"ethers": "^6.10.0",
"hardhat": "^2.19.5",
"prettier": "^3.2.4",
"prettier-plugin-solidity": "^1.3.1"
},
Expand Down
10 changes: 5 additions & 5 deletions smart-contracts-hardhat/scripts/deployEOA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ dotenv.config();
async function main() {
const [deployer] = await ethers.getSigners();
const customToken = await ethers.deployContract('MyCustomToken', [
'My Custom Token', // token name
'MCT', // token symbol
deployer.address, // contract owner
0, // token type = TOKEN
false, // isNonDivisible?
'My Custom Token', // token name
'MCT', // token symbol
deployer.address, // contract owner
0, // token type = TOKEN
false, // isNonDivisible?
]);

await customToken.waitForDeployment();
Expand Down
22 changes: 11 additions & 11 deletions smart-contracts-hardhat/scripts/deployUP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dotenv.config();

async function main() {
// setup provider
const provider = new ethers.providers.JsonRpcProvider('https://rpc.testnet.lukso.gateway.fm');
const provider = new ethers.JsonRpcProvider('https://rpc.testnet.lukso.gateway.fm');

// setup signer (the browser extension controller)
const signer = new ethers.Wallet(process.env.PRIVATE_KEY as string, provider);
Expand All @@ -19,15 +19,15 @@ async function main() {

const tokenFactory = await ethers.getContractFactory('MyCustomToken');

const deplyedTransaction = await tokenFactory.getDeployTransaction([
'My Custom Token', // token name
'MCT', // token symbol
signer.address, // token owner
0, // token type = TOKEN
false, // isNonDivisible?
]);
const deployTx = tokenFactory.getDeployTransaction(
"My Custom Token", // token name
"MCT", // token symbol
signer.address, // token owner
0, // token type = TOKEN
false // isNonDivisible?
);

console.log('test: ', deplyedTransaction);
console.log('test: ', deployTx);

/**
* Custom LSP7 Token
Expand All @@ -38,12 +38,12 @@ async function main() {
// get the address of the contract that will be created
const CustomTokenAddress = await UP.connect(signer)
.getFunction('execute')
.staticCall(1, ethers.constants.AddressZero, 0, CustomTokenBytecode);
.staticCall(1, ethers.ZeroAddress, 0, CustomTokenBytecode);

// deploy CustomLSP7 as the UP (signed by the browser extension controller)
const tx1 = await UP.connect(signer).getFunction('execute')(
1,
ethers.constants.AddressZero,
ethers.ZeroAddress,
0,
CustomTokenBytecode,
);
Expand Down

0 comments on commit b62d6a5

Please sign in to comment.