Approving Collateral tokens
Approve collateral token transfers
Last updated
Approve collateral token transfers
Last updated
In the Ethereum token ecosystem a common practice has developed around transferring ERC20 tokens by a smart contract on behalf of a user. In order to create a piggy with the SmartPiggy smart contract the transacting account must first allow the SmartPiggies smart contract to transfer the collateral from the user to the SmartPiggies smart contract.
This approval must be done for each collateral token a user wants to collateralize a piggy with. If a user wanted to make a piggy collateralized with USDC, and an additional piggy collateralized with DAI, that user must make an approval for USDC and an approval for DAI.
To complete this approval, the connected account can select the toggle to the left of the desired collateral listed in the Manage Wallet menu:
In the image above, truffle token (TRFL) is already approved, but chainlink (LINK) is not approved. To approve LINK the connected account can click the toggle. This will prompt a MetaMask confirmation modal. When the transaction has succeeded, that account can use the approved token with the SmartPiggies smart contract.
Visit the next section to review approving oracle tokens.
Technically this is only an accounting update to the state of the collateral token smart contract, there are no tokens or Ethereum held in the SmartPiggies smart contract.