git-consensus / contracts

Converts the informal ownership structure of an open-source git project to a formal DAO, with token distribution mechanisms for contributors.
GNU General Public License v3.0
13 stars 0 forks source link

update maxMintablePerHash to treat zero value as no max #16

Closed mattstam closed 2 years ago

mattstam commented 2 years ago

Description

Treat a zero value for maxMintablePerHash to be no maximum. This allows any value to be minted for a particular git hash owner.

Test Coverage

forge test --match=testOk_createdToken
[⠊] Compiling...
[⠃] Compiling 54 files with 0.8.17
[⠒] Solc 0.8.17 finished in 63.99s
Compiler run successful

Running 2 tests for contracts/test/TokenFactory.t.sol:WhenAfterTokenCreated
[PASS] testOk_createdTokenAboveMaxMintablePerHashFailed(address,address,address,string,string,bytes32) (runs: 256, μ: 331727, ~: 324032)
[PASS] testOk_createdTokenZeroMaxMintablePerHash(address,address,address,string,string,bytes32) (runs: 256, μ: 401013, ~: 399376)
Test result: ok. 2 passed; 0 failed; finished in 32.02ms