Coder Social home page Coder Social logo

valvalu / bayc-invariant-testing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karmacoma-eth/bayc-invariant-testing

0.0 0.0 0.0 166 KB

Uses dapptools to find that the max supply invariant can be violated by the contract owner

License: The Unlicense

Shell 11.29% Nix 0.46% Makefile 1.87% Solidity 86.38%

bayc-invariant-testing's Introduction

BAYC Max Supply Invariant Testing

Based on:

You can see an example of the failed invariant test in invariantFailure.log

The test in src/test/BoredApeYachtClub.t.sol has this:

    function invariantTotalSupply() public {
        assertLe(bayc.totalSupply(), MAX_APES);
    }

It ensures that the totalSupply() of bored apes remains under the defined maximum. However the test fails, and gives an example that shows how to violate that invariant: the owner can call bayc.reserveApes() at any time and bypass the MAX_APES check, therefore the supply of bored apes is actually unlimited.

Building and testing

make # This installs the project's dependencies.
make test

Installing the toolkit

If you do not have DappTools already installed, you'll need to run the below commands

Install Nix

# User must be in sudoers
curl -L https://nixos.org/nix/install | sh

# Run this or login again to use Nix
. "$HOME/.nix-profile/etc/profile.d/nix.sh"

Install DappTools

curl https://dapp.tools/install | sh

DappTools Resources

bayc-invariant-testing's People

Contributors

0xruhum avatar gakonst avatar gg2001 avatar karmacoma-eth avatar mds1 avatar ncitron avatar odyslam avatar onbjerg avatar patrickalphac avatar sambacha avatar samwilsn avatar tarrencev avatar transmissions11 avatar xmxanuel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.