Scripts to help you interact with the Conditional Tokens contracts.
This project uses Foundry. For more information, see the Foundry Book.
To install on macOS or Linux, first download foundryup
:
curl -L https://foundry.paradigm.xyz | bash
Then, install Foundry by running:
foundryup
For other installation types, see the Foundry Book's installation instructions.
Make sure to create a .env
file following the template in .env.example
.
Note: the conditionId is specified in the .env
file.
./run.sh [OPTIONS] SCRIPT_NAME
# e.g.
./run.sh -a 1000 -b mint_usdc
./run.sh -a 500 split
./run.sh balances
-a
: Specify an amount formint_usdc
,split
, andmerge
scripts.-b
: Broadcast the transaction on chain. Omit to simulate the transaction locally.
balances
: Gets USDC, conditional token, and gas token balances.mint_usdc
: Mint USDC (on Mumbai).split
: Split collateral into conditional tokens.merge
: Merge complete set of conditional tokens to collateral.
To make a random new wallet execute cast wallet new
.
To get Mumbai Matic (or Goërli ETH) visit https://faucet.polygon.technology
The USDC contract on Mumbai is mintable with signature "mint(address,uint256)"
. In particular, it implements src/interfaces/IERC20Mintable.sol
.