contracts
directory. In the directory, create your ERC-20 contract: myL2token.sol
.
2_deploy_contracts.js
in the migrations
directory.
100 ML2T
tokens.
HDWalletProvider
.
HDWalletProvider is Truffle’s separate npm package used to sign transactions.
Run:
truffle-config.js
to add:
HDWalletProvider
goerli
— any network name that you will pass to the truffle migrate --network
command.HDWalletProvider
— Truffle’s custom provider to sign transactions.network_id
— the network ID of the Ethereum Goerli testnet: 5
.solc
— the Solidity compiler version that Truffle must use.2_deploy_contracts.js
and deploy the contract to the Ethereum Goerli testnet as specified in truffle-config.js
.
.sol
file to make Etherscan be able to verify it.
Install Truffle Flattener.
In the contracts
directory, run:
SPDX
mentions in the file and remove all of them except for the very first one.
.sol
contract in the Enter the Solidity Contract Code below field.
contracts
directory. In the directory, put the default child ERC-20 contract provided by Polygon.
2_deploy_contracts.js
in the migrations
directory.
myL2tokenChild
— the name of your ERC-20 tokenML2T
— the symbol of your ERC-20 token18
— the default decimals number as used by the OpenZeppelin ERC-20 preset contract0x2e5e27d50EFa501D90Ad3638ff8441a0C0C0d75e
— the ChildChainmanager address on the Polygon Mumbai testnet. For the ChildChainManager contract addresses, look online for the addresses provided by Polygon:
myL2token.sol
and flatmyL2token.sol
to a backup directory so that Truffle does not pick them up for deployment.
truffle-config.js
to change to:
mumbai
— any network name that you will pass to the truffle migrate --network
command.HDWalletProvider
— Truffle’s custom provider to sign transactions.network_id
— the network ID of the Polygon network: testnet is 80001
, mainnet is 137
.solc
— the Solidity compiler version that Truffle must use. OpenZeppelin contracts have a higher version Solidity compiler requirement than the default Truffle installation, hence you must provide a specific compiler version.contract address
field.ChildERC20.sol
contract in the Enter the Solidity Contract Code below field.{}
and "abi":
or the code will not parse.
myL2tokenChild
ML2T
18
0x2e5e27d50EFa501D90Ad3638ff8441a0C0C0d75e