Day 2 Homework
Please note, only participants who finish their homework for all three days will be eligible for the Certificate of Completion.
Submit your public GitHub repo for the exercise below via this form
Using chainlink-local write a test for the https://github.com/smartcontractkit/ccip-cross-chain-name-service project. You can use https://cll-devrel.gitbook.io/chainlink-local-documentation for help.
During the Exercise #3 we used Chainlink Local's Forked Mode with Foundry. For this homework you should use Chainlink Local's Local Mode with Hardhat.
In the test you must:
Create an instance of
CCIPLocalSimulator.sol
smart contract.Call the
configuration()
function to get Router contract address.Create instances of
CrossChainNameServiceRegister.sol
,CrossChainNameServiceReceiver.sol
andCrossChainNameServiceLookup.sol
smart contracts and call theenableChain()
function where needed.Call the
setCrossChainNameServiceAddress
function of theCrossChainNameServiceLookup.sol
smart contract "source" instance and provide the address of theCrossChainNameServiceRegister.sol
smart contract instance. Repeat the process for theCrossChainNameServiceLookup.sol
smart contract "receiver" instance and provide the address of theCrossChainNameServiceReceiver.sol
smart contract instance.Call the
register()
function and provide “alice.ccns” and Alice’s EOA address as function arguments.Call the
lookup()
function and provide “alice.ccns” as a function argument. Assert that the returned address is Alice’s EOA address.Send a url pointing to the public Github repository.
DO NOT PROVIDE PRIVATE KEY OR TESTNET RPC DETAILS, USE HARDHAT NETWORK ONLY! npx hardhat test --network hardhat
Last updated