me-foundation / magicdrop

MagicDrop is a collection of EVM minting protocols that enable the multi stage minting, per stage WL management, per stage supply limit, and crossmint support.
MIT License
54 stars 37 forks source link

Make timestamp expiry seconds configurable #45

Closed mi-yu closed 1 year ago

mi-yu commented 1 year ago

On mainnet, 60 seconds is too aggressive causing many transactions to fail with TimestampExpired. This PR makes the expiry threshold configurable via:

    function setTimestampExpirySeconds(uint64 expiry) external onlyOwner {
        _timestampExpirySeconds = expiry;
        emit SetTimestampExpirySeconds(expiry);
    }

Coverage:

---------------------------|----------|----------|----------|----------|----------------|
File                       |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
---------------------------|----------|----------|----------|----------|----------------|
 contracts/                |      100 |    89.58 |      100 |      100 |                |
  BucketAuction.sol        |      100 |    91.03 |      100 |      100 |                |
  DutchAuction.sol         |      100 |    88.64 |      100 |      100 |                |
  ERC721M.sol              |      100 |    90.74 |      100 |      100 |                |
  ERC721MCallback.sol      |      100 |       70 |      100 |      100 |                |
  IBucketAuction.sol       |      100 |      100 |      100 |      100 |                |
  IDutchAuction.sol        |      100 |      100 |      100 |      100 |                |
  IERC721M.sol             |      100 |      100 |      100 |      100 |                |
  IERC721MCallback.sol     |      100 |      100 |      100 |      100 |                |
 contracts/mocks/          |    76.92 |       50 |     87.5 |       80 |                |
  TestReentrantExploit.sol |       75 |      100 |      100 |       80 |             35 |
  TestStaking.sol          |    77.78 |       50 |       80 |       80 |          25,26 |
---------------------------|----------|----------|----------|----------|----------------|
All files                  |    98.56 |    88.93 |    98.88 |    98.94 |                |
---------------------------|----------|----------|----------|----------|----------------|
channing-magiceden commented 1 year ago

Pls also add test coverage in description.