SmartPiggies
HomepageAppPink PaperDiscord
  • Introduction
  • Getting Started
    • Accessing Testnet
    • What is a SmartPiggy NFT?
      • Background: What is a financial option?
    • Where do Piggies live?
      • Arbitrum Introduction
      • How to use Arbitrum
    • Parts of a Piggy
    • An example Piggy
    • Creating your first Piggy
      • Create a Piggy
      • Request a Piggy
  • Lifecycle of a Piggy
    • Approve Collateral
    • Auction
    • Buy
    • Bid
    • Finalize
    • Clear
    • Settle
    • Claim payout
    • Burn - Reclaim collateral
  • Advanced Functions
    • Transfer
    • Split
  • The User Interface
    • Explore Markets
      • Table Dropdown
    • My Dashboard
      • Table Dropdown
    • Wallet
      • Approving Collateral tokens
      • Approving Oracle tokens
      • Claiming payouts
      • Supported wallets
  • Oracles
    • Available oracles
    • Using your own oracles
    • SmartPiggies and Oracles
  • Arbitration
    • The (optional) Need for Arbitration
    • Setting an arbitrator
    • The Arbitration Process
    • Arbiter Reputation and History
  • FAQ
  • FAQ
  • Developers
    • Contracts
      • Calling the contracts directly
Powered by GitBook
On this page

Was this helpful?

  1. The User Interface
  2. Wallet

Approving Collateral tokens

Approve collateral token transfers

PreviousWalletNextApproving Oracle tokens

Last updated 3 years ago

Was this helpful?

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. 1^11

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.

Footnotes

  1. 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.