/toobins

Primary LanguageTypeScript

Toobins

  1. Setup
    1. Install dependencies → pnpm i
    2. Look through ./hardhat.config.ts for environment variables
    3. Configure environment variables → ./env
  2. Run tests → pnpm test
  3. Run test coverage → pnpm coverage
    1. Open coverage/index.html to see 100% test coverage
  4. Deploy → pnpm hatdeploy → Follow prompts
  5. Verify source code → pnpm hatverify → Follow prompts

Important Notes

The NFT smart contract (contracts/Toobins.sol) and the delegate.cash interface (contracts/IDelegationRegistry.sol) can be tested and deployed from this project or you can just copy them into your preferred environment.

contracts/MockMoonbirds.sol only exists for the purposes of testing.

mockend/* only exists for making the mocked Goerli endpoint for serving OpenSea metadata, I'm assuming you'll provide your own metadata backend.

Deployment

If you want to deploy you'll need to set up environment variables (./env) and the constructor arguments for metadata in scripts/run/use/args.ts.

I use alchemy API to deploy but you can configure your own provider in hardhat.config.ts.

Testnet Deploys

Addresses

  • primary → 0xb0436355746155dFB1bbD4b029241D7dee168FFd
  • secondary → 0x79d17Aaf7816578C5B110d69E76C96189e747762
  • tertiary → 0x66937401467317541fDd9f5988A4AB71b92Fd423
  • quarternary → 0x61fA6bF463Eb079F52932A7ED5bA0e63505D8Ed5
  • quinary → 0x992c983C235AffA30372ee6759319f89989ad4Db
  • senary → 0x96BCC28FD42835103d2902BDae50C9B3d13F5598

Transaction Log (2023-06-25)

OpenSea collection / Etherscan contract

  1. primary → deployed mock moonbirds to goerli
  2. secondary → minted moonbird
  3. secondary → made tertiary delegate for secondary
  4. primary → deployed toobins
  5. primary → initiated with quarternary NOTE: I had to manually set the gas limit in Metamask
  6. quarternary → pass to tertiary NOTE: this is where the delegation is tested, because tertiary does not have a moonbird, but it is a delegate for secondary
  7. tertiary → attempt to transfer to quinary, reverted as expected because no moonbird
  8. quinary → mint moonbird
  9. tertiary → transfer to quinary

Transaction Log (2023-07-07)

OpenSea collection / Etherscan contract

  1. primary → deployed toobins
  2. primary → initiated with quarternary
  3. quarternary → pass to tertiary
  4. tertiary → transfer to quinary
  5. quinary → attempt to pass to senary, reverted as expected because no moonbird
  6. primary → yoinked to conclude run
  7. quinary → attempt to transfer Toobins, reverted, showing fix for exploit 1