- Only the owner can mint dTSLA
- Anyone can redeem dTSLA for USDC or "the stablecoin" of the choice.
- Chainlink functions will kick off a TSLA sell for USDC,and then send it to the contract
- Then user will have to then call finishRedeem to get their USDC.
Example Workflow
1. Minting:
. The owner mints 1,000 dTSLA tokens.
2. Redeeming:
. A user holding 10 dTSLA tokens initiates a redeem call.
. Chainlink executes a TSLA sale equivalent to the value of 10 dTSLA tokens and transfers the resulting USDC to the contract.
3. Finalizing Redemption:
. Once the USDC from the TSLA sale arrives in the contract, the user calls finishRedeem.
. The contract transfers the equivalent USDC amount to the user’s wallet.
forge install smartcontractkit/[email protected] --no-commit
$ forge build
$ forge test
$ forge fmt
$ forge snapshot
$ anvil
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
$ cast <subcommand>
$ forge --help
$ anvil --help
$ cast --help