ERC-404 is a new experimental way of combining two existing standards in the cryptocurrency world: ERC-20 and ERC-721. It aims to allow for both regular token transactions (like ERC-20) and unique, non-fungible tokens (like ERC-721) to work together smoothly.
To make this work, ERC-404 uses a method called "pathing." Pathing is a bit like fitting two things into one space by overlapping them. It's not perfect, but it tries to make sure everything fits without causing major problems.
If other systems want to work with ERC-404, they need to make sure they understand and follow these overlapping rules.
This version of ERC-404 tries to solve common problems and make it easier for different systems to work together. But because it's still new and hasn't been fully checked by experts, there might be issues that need to be fixed.
Overall, ERC-404 is an experiment that tries to combine two different cryptocurrency standards in a way that makes sense.
Ensure you have a .env
file in the project root directory with the necessary environment variables. The available options are:
ACCOUNT_PRIVATE_KEY
: Specify the private key from which the contracts will be deployedALCHEMY_MAINNET_API_KEY
: Specify the alchemy mainnet api keyALCHEMY_SEPOLIA_API_KEY
: Specify the alchemy sepolia api keyALCHEMY_POLYGON_API_KEY
: Specify the alchemy polygon api keyALCHEMY_MUMBAI_API_KEY
: Specify the alchemy polygon mumbai api keyETHERSCAN_API_KEY
: Specify the etherscan api key for verifying contractsPOLYGONSCAN_API_KEY
: Specify the polygonscan api key for verifying contractsDEPLOY_NETWORK
: Specify the network for deployment (e.g.,sepolia
,polygonMumbai
,polygon
,mainnet
)IMAGE_URL
: Specify the image url to be set in the Contract's DataURI
Before deploying and verifying the contract, don't forget to pass the owner address in the constructor parameters in the deploy and verify tasks.
// deploy
const myErc404 = await ethers.deployContract(CONTRACT_NAMES.MY_ERC404, [
'/* owner address */',
]);
// verify
await run('verify:verify', {
address: myErc404.address,
constructorArguments: ['/* owner address */'],
});
cp .env.example .env`
Clean and compile contracts with below commands
npx hardhat clean
npx hardhat compile
Deploys the MyERC404 contract to the specified network.
npx hardhat deploy:my-erc404 --network sepolia
npx hardhat deploy:my-erc404 --network mainnet
This task will deploy the MyERC404
contract using the specified network and output the deployed contract address.
Verifies the MyERC404 contract on the specified network.
npx hardhat verify:my-erc404 --network sepolia
npx hardhat verify:my-erc404 --network mainnet
This task will verify the MyERC404
contract on the specified network. It retrieves the contract address from the previously deployed contract and uses it for verification.
Exports the ABI for the MyERC404 contract.
npx hardhat abi:my-erc404
This task will export the ABI for the MyERC404.sol
contract and save it as MyERC404.json
.
Whitelists the owner of the contract.
npx hardhat whitelist-owner:my-erc404 --network sepolia
npx hardhat whitelist-owner:my-erc404 --network mainnet
This task will whitelist the deployer/owner of the contract. Whitelisting will exempt them from token minting and burning during transfers
Sets the dataURI for the NFTs.
npx hardhat set-data-uri --network sepolia
npx hardhat set-data-uri --network mainnet
This task involves setting the IMAGE_URL
from the .env file as the dataURI
within the contract.