Toobins
- Setup
- Install dependencies →
pnpm i
- Look through
./hardhat.config.ts
for environment variables - Configure environment variables →
./env
- Install dependencies →
- Run tests →
pnpm test
- Run test coverage →
pnpm coverage
- Open
coverage/index.html
to see 100% test coverage
- Open
- Deploy →
pnpm hat
→deploy
→ Follow prompts - Verify source code →
pnpm hat
→verify
→ 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
- primary → deployed mock moonbirds to goerli
- secondary → minted moonbird
- secondary → made tertiary delegate for secondary
- primary → deployed toobins
- primary → initiated with quarternary NOTE: I had to manually set the gas limit in Metamask
- 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
- tertiary → attempt to transfer to quinary, reverted as expected because no moonbird
- quinary → mint moonbird
- tertiary → transfer to quinary
Transaction Log (2023-07-07)
OpenSea collection / Etherscan contract
- primary → deployed toobins
- primary → initiated with quarternary
- quarternary → pass to tertiary
- tertiary → transfer to quinary
- quinary → attempt to pass to senary, reverted as expected because no moonbird
- primary → yoinked to conclude run
- quinary → attempt to transfer Toobins, reverted, showing fix for exploit 1