Interaction Flow With Fees
Go trhough the complete deployment flow and send an incentivized message.
We have all the Smart Contract 📜 set we can start sending incentivized Cross-Chain messages. Now let complete the flow
- Deploy sender contract on C-chain
- Deploy receiver contract on mysubnet
- Approve the sender contract to spend ERC20 funds from the message sender address
- Send the message
Deploy Sender Contract
To deploy the sender contract run:
Save the sender contract address to an enviroment variable
Deploy Receiver Contract
Now, deploy the receiver contract.
Save the receiver contract address to an enviroment variable
Approve ERC20 token expense
👩 The Message Sender (User) requires to approve the Cross-Subnet dApp as a spender on the ERC20 contract to be used as fee. To do that lets use the function "approve" on our deployed FEE contract.