This is the repo to hold all evm smart contracts for Hexlink, including:
- The account contract implementation
- The Hexlink name registry implementation
- The Hexlink implementation
The design(outdated) could be found at:
# clean and compile contracts
npx hardhat clean; npx hardhat compile
# run tests
npx hardhat test
# deploy to local
doppler run -- npx hardhat deploy --tags PROD
# deploy to goerli testnet
doppler run -- npx hardhat deploy --network goerli --tags PROD
doppler run -- npx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS $CONSTRUCTOR_PARAMS
Contract | Address |
---|---|
ContractFactory | 0xF4CCB60BeAb96E801A2c3598e15b4d1Ed72ECa53 |
AccountProxy | 0x4c552dC72756A690883f9e8955B231c43c4E598e |
HexlinkProxy | 0x4c552dC72756A690883f9e8955B231c43c4E598e |
To ensure all derived accounts share same addresses across different chains, we need to fix the addresses of ContractFactory , HexlinkProxy and AccountProxy. HexlinkProxy and AccountProxy share the same proxy implementation as "HexlinkERC1967Proxy". The contract factory is deployed with 0x9Afa9fcf35E2486cF3E6775FC9eD93EA14de2926.
TBD
# deploy contracts
doppler run -- npx hardhat deploy --network sepolia
# check deployed contract
doppler run -- npx hardhat hexlink_check --network sepolia
# stake token for hexlink contract since it
# has to access its storage during deployment
doppler run -- npx hardhat add_stake --network sepolia
# deploy contracts to lastest version
doppler run -- npx hardhat deploy --network sepolia
# upgrade hexlink implementation
doppler run -- npx hardhat upgrade_hexlink --network sepolia
# upgrade account implementation
doppler run -- npx hardhat upgrade_account --network sepolia