Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 1.28 KB

README.md

File metadata and controls

76 lines (54 loc) · 1.28 KB
  1. Only the owner can mint dTSLA
  2. Anyone can redeem dTSLA for USDC or "the stablecoin" of the choice.
  3. Chainlink functions will kick off a TSLA sell for USDC,and then send it to the contract
  4. 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.

Usage

install

forge install smartcontractkit/[email protected] --no-commit

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help