Address Contract Verified
Address
0x2493B044EB5f0e1dBaEaB28dD87f17D9727537Ae
Balance
0 ETH
Nonce
1
Code Size
10015 bytes
Creator
0x71421472...5F91 at tx 0x6d0c8c46...2c296c
Indexed Transactions
0
Contract Bytecode
10015 bytes
0x6080604052600436106101cd5760003560e01c80637cb64759116100f7578063bef9ec7411610095578063dc763cb511610064578063dc763cb5146105fe578063ddca3f4314610629578063e5a8761414610654578063f0f442601461067d576101cd565b8063bef9ec7414610554578063caa52e8d1461057f578063d547741f146105aa578063d8f858a7146105d3576101cd565b80639222f413116100d15780639222f413146104cd578063a217fddf146104d7578063a785af8314610502578063aa53bcbc1461052b576101cd565b80637cb64759146104505780638efe34141461047957806391d1485414610490576101cd565b806336568abe1161016f57806361d027b31161013e57806361d027b3146103ba57806369fe0e2d146103e55780636d79c1621461040e57806379de186a14610425576101cd565b806336568abe146103335780633779147e1461035c57806339c72af91461037857806355c96b991461038f576101cd565b8063248a9ca3116101ab578063248a9ca3146102775780632a215843146102b45780632eb4a7ab146102df5780632f2ff15d1461030a576101cd565b806301ffc9a7146101d25780630f4161aa1461020f5780631e7269c51461023a575b600080fd5b3480156101de57600080fd5b506101f960048036038101906101f49190611bcf565b6106a6565b6040516102069190611c17565b60405180910390f35b34801561021b57600080fd5b50610224610720565b6040516102319190611c17565b60405180910390f35b34801561024657600080fd5b50610261600480360381019061025c9190611c90565b610733565b60405161026e9190611c17565b60405180910390f35b34801561028357600080fd5b5061029e60048036038101906102999190611cf3565b610753565b6040516102ab9190611d2f565b60405180910390f35b3480156102c057600080fd5b506102c9610772565b6040516102d69190611da9565b60405180910390f35b3480156102eb57600080fd5b506102f4610798565b6040516103019190611d2f565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c9190611dc4565b61079e565b005b34801561033f57600080fd5b5061035a60048036038101906103559190611dc4565b6107c7565b005b61037660048036038101906103719190611e69565b61084a565b005b34801561038457600080fd5b5061038d6109dc565b005b34801561039b57600080fd5b506103a4610a4a565b6040516103b19190611ed7565b60405180910390f35b3480156103c657600080fd5b506103cf610a70565b6040516103dc9190611f13565b60405180910390f35b3480156103f157600080fd5b5061040c60048036038101906104079190611f64565b610a96565b005b34801561041a57600080fd5b50610423610ae3565b005b34801561043157600080fd5b5061043a610b51565b6040516104479190611c17565b60405180910390f35b34801561045c57600080fd5b5061047760048036038101906104729190611cf3565b610b64565b005b34801561048557600080fd5b5061048e610bb1565b005b34801561049c57600080fd5b506104b760048036038101906104b29190611dc4565b610c1f565b6040516104c49190611c17565b60405180910390f35b6104d5610c89565b005b3480156104e357600080fd5b506104ec610d69565b6040516104f99190611d2f565b60405180910390f35b34801561050e57600080fd5b5061052960048036038101906105249190611f91565b610d70565b005b34801561053757600080fd5b50610552600480360381019061054d9190611f64565b610e9c565b005b34801561056057600080fd5b50610569610ee9565b6040516105769190611ff2565b60405180910390f35b34801561058b57600080fd5b50610594610f0f565b6040516105a19190611ed7565b60405180910390f35b3480156105b657600080fd5b506105d160048036038101906105cc9190611dc4565b610f35565b005b3480156105df57600080fd5b506105e8610f5e565b6040516105f59190611c17565b60405180910390f35b34801561060a57600080fd5b50610613610f71565b604051610620919061201c565b60405180910390f35b34801561063557600080fd5b5061063e610f77565b60405161064b919061201c565b60405180910390f35b34801561066057600080fd5b5061067b60048036038101906106769190611c90565b610f7d565b005b34801561068957600080fd5b506106a4600480360381019061069f9190612063565b61101a565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061071957506107188261111d565b5b9050919050565b600960149054906101000a900460ff1681565b600a6020528060005260406000206000915054906101000a900460ff1681565b6000806000838152602001908152602001600020600101549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6107a782610753565b6107b8816107b3611187565b61118f565b6107c2838361122c565b505050565b6107cf611187565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461083c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083390612113565b60405180910390fd5b610846828261130c565b5050565b60026001540361088f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108869061217f565b60405180910390fd5b6002600181905550600960159054906101000a900460ff166108dd576040517faff40fa400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336040516020016108f091906121e7565b604051602081830303815290604052805190602001209050610956838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050600254836113ed565b61098c576040517f0ed6f64500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004543410156109c8576040517ff14a42b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109d0611404565b50600180819055505050565b6000801b6109f1816109ec611187565b61118f565b600960169054906101000a900460ff1615600960166101000a81548160ff0219169083151502179055507f46ff0c76fa410b7c11ec6f9791c5cba5fa3e7bb10430e2d34ff3c72ea40cf89160405160405180910390a150565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000801b610aab81610aa6611187565b61118f565b81600381905550817f4dc6b613ed29567b1028693355a878a3884c14a50f9514db7e4b924d2550a6da60405160405180910390a25050565b6000801b610af881610af3611187565b61118f565b600960149054906101000a900460ff1615600960146101000a81548160ff0219169083151502179055507fc8788ff4f1682f934af1e802d7eba86a2f46b549cd2b4c979dfa881ccabb546360405160405180910390a150565b600960159054906101000a900460ff1681565b6000801b610b7981610b74611187565b61118f565b81600281905550817f42cbc405e4dbf1b691e85b9a34b08ecfcf7a9ad9078bf4d645ccfa1fac11c10b60405160405180910390a25050565b6000801b610bc681610bc1611187565b61118f565b600960159054906101000a900460ff1615600960156101000a81548160ff0219169083151502179055507f044b7f9cb68aab1e030d1849bf79977c39a41ce4502e3bc1bd4ba206c0a1c8ae60405160405180910390a150565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600260015403610cce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc59061217f565b60405180910390fd5b6002600181905550600960149054906101000a900460ff16610d1c576040517febe2300100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600354341015610d58576040517ff14a42b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d60611404565b60018081905550565b6000801b81565b6000801b610d8581610d80611187565b61118f565b60018203610dd35782600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e54565b60028203610e215782600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e53565b6040517fa9146eeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b8273ffffffffffffffffffffffffffffffffffffffff167fc105fee7bbcec7b2c65680659fd201df516800b3a71d2bc4bf9844ee4ffabbb460405160405180910390a2505050565b6000801b610eb181610eac611187565b61118f565b81600481905550817fae30ced08143fd2c7201c032beba7f9af3502e8ced7d6ec017c15abea504604960405160405180910390a25050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f3e82610753565b610f4f81610f4a611187565b61118f565b610f59838361130c565b505050565b600960169054906101000a900460ff1681565b60045481565b60035481565b6000801b610f9281610f8d611187565b61118f565b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167fd61d234e0bd1d1c23a5fd4675e110b5373972cdb88b9ca71bac1efcef928146960405160405180910390a25050565b6000801b61102f8161102a611187565b61118f565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611095576040517f14bcf5c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f5cc4bdb402e519d4921d6bfaca9c17c16ea3a8e658ff5accd29e6080635562ce60405160405180910390a25050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b6111998282610c1f565b611228576111be8173ffffffffffffffffffffffffffffffffffffffff16601461187e565b6111cc8360001c602061187e565b6040516020016111dd92919061230b565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121f919061238f565b60405180910390fd5b5050565b6112368282610c1f565b61130857600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506112ad611187565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6113168282610c1f565b156113e957600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061138e611187565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000826113fa8584611aba565b1490509392505050565b600960169054906101000a900460ff1680156115b35750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061150d5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e7269c5336040518263ffffffff1660e01b81526004016114c991906123c0565b6020604051808303816000875af11580156114e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150c9190612407565b5b806115b25750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e7269c5336040518263ffffffff1660e01b815260040161156e91906123c0565b6020604051808303816000875af115801561158d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b19190612407565b5b5b156115ea576040517ff5f915f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163460405161168a90612465565b60006040518083038185875af1925050503d80600081146116c7576040519150601f19603f3d011682016040523d82523d6000602084013e6116cc565b606091505b5050905080611707576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd548470336040518263ffffffff1660e01b815260040161176491906123c0565b6020604051808303816000875af1158015611783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a7919061248f565b90503373ffffffffffffffffffffffffffffffffffffffff16817f14e3355a5b1dcc3894caaaf7216f77c26501d2fd07df2e0ed983e38161d8239760405160405180910390a3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d71a7552826040518263ffffffff1660e01b8152600401611848919061201c565b600060405180830381600087803b15801561186257600080fd5b505af1158015611876573d6000803e3d6000fd5b505050505050565b60606000600283600261189191906124eb565b61189b919061252d565b67ffffffffffffffff8111156118b4576118b3612561565b5b6040519080825280601f01601f1916602001820160405280156118e65781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061191e5761191d612590565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061198257611981612590565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026119c291906124eb565b6119cc919061252d565b90505b6001811115611a6c577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611a0e57611a0d612590565b5b1a60f81b828281518110611a2557611a24612590565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611a65906125bf565b90506119cf565b5060008414611ab0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa790612634565b60405180910390fd5b8091505092915050565b60008082905060005b8451811015611b62576000858281518110611ae157611ae0612590565b5b60200260200101519050808311611b22578281604051602001611b05929190612675565b604051602081830303815290604052805190602001209250611b4e565b8083604051602001611b35929190612675565b6040516020818303038152906040528051906020012092505b508080611b5a906126a1565b915050611ac3565b508091505092915050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611bac81611b77565b8114611bb757600080fd5b50565b600081359050611bc981611ba3565b92915050565b600060208284031215611be557611be4611b6d565b5b6000611bf384828501611bba565b91505092915050565b60008115159050919050565b611c1181611bfc565b82525050565b6000602082019050611c2c6000830184611c08565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c5d82611c32565b9050919050565b611c6d81611c52565b8114611c7857600080fd5b50565b600081359050611c8a81611c64565b92915050565b600060208284031215611ca657611ca5611b6d565b5b6000611cb484828501611c7b565b91505092915050565b6000819050919050565b611cd081611cbd565b8114611cdb57600080fd5b50565b600081359050611ced81611cc7565b92915050565b600060208284031215611d0957611d08611b6d565b5b6000611d1784828501611cde565b91505092915050565b611d2981611cbd565b82525050565b6000602082019050611d446000830184611d20565b92915050565b6000819050919050565b6000611d6f611d6a611d6584611c32565b611d4a565b611c32565b9050919050565b6000611d8182611d54565b9050919050565b6000611d9382611d76565b9050919050565b611da381611d88565b82525050565b6000602082019050611dbe6000830184611d9a565b92915050565b60008060408385031215611ddb57611dda611b6d565b5b6000611de985828601611cde565b9250506020611dfa85828601611c7b565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f840112611e2957611e28611e04565b5b8235905067ffffffffffffffff811115611e4657611e45611e09565b5b602083019150836020820283011115611e6257611e61611e0e565b5b9250929050565b60008060208385031215611e8057611e7f611b6d565b5b600083013567ffffffffffffffff811115611e9e57611e9d611b72565b5b611eaa85828601611e13565b92509250509250929050565b6000611ec182611d76565b9050919050565b611ed181611eb6565b82525050565b6000602082019050611eec6000830184611ec8565b92915050565b6000611efd82611c32565b9050919050565b611f0d81611ef2565b82525050565b6000602082019050611f286000830184611f04565b92915050565b6000819050919050565b611f4181611f2e565b8114611f4c57600080fd5b50565b600081359050611f5e81611f38565b92915050565b600060208284031215611f7a57611f79611b6d565b5b6000611f8884828501611f4f565b91505092915050565b60008060408385031215611fa857611fa7611b6d565b5b6000611fb685828601611c7b565b9250506020611fc785828601611f4f565b9150509250929050565b6000611fdc82611d76565b9050919050565b611fec81611fd1565b82525050565b60006020820190506120076000830184611fe3565b92915050565b61201681611f2e565b82525050565b6000602082019050612031600083018461200d565b92915050565b61204081611ef2565b811461204b57600080fd5b50565b60008135905061205d81612037565b92915050565b60006020828403121561207957612078611b6d565b5b60006120878482850161204e565b91505092915050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b60006120fd602f83612090565b9150612108826120a1565b604082019050919050565b6000602082019050818103600083015261212c816120f0565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612169601f83612090565b915061217482612133565b602082019050919050565b600060208201905081810360008301526121988161215c565b9050919050565b60008160601b9050919050565b60006121b78261219f565b9050919050565b60006121c9826121ac565b9050919050565b6121e16121dc82611c52565b6121be565b82525050565b60006121f382846121d0565b60148201915081905092915050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612243601783612202565b915061224e8261220d565b601782019050919050565b600081519050919050565b60005b83811015612282578082015181840152602081019050612267565b60008484015250505050565b600061229982612259565b6122a38185612202565b93506122b3818560208601612264565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006122f5601183612202565b9150612300826122bf565b601182019050919050565b600061231682612236565b9150612322828561228e565b915061232d826122e8565b9150612339828461228e565b91508190509392505050565b6000601f19601f8301169050919050565b600061236182612259565b61236b8185612090565b935061237b818560208601612264565b61238481612345565b840191505092915050565b600060208201905081810360008301526123a98184612356565b905092915050565b6123ba81611c52565b82525050565b60006020820190506123d560008301846123b1565b92915050565b6123e481611bfc565b81146123ef57600080fd5b50565b600081519050612401816123db565b92915050565b60006020828403121561241d5761241c611b6d565b5b600061242b848285016123f2565b91505092915050565b600081905092915050565b50565b600061244f600083612434565b915061245a8261243f565b600082019050919050565b600061247082612442565b9150819050919050565b60008151905061248981611f38565b92915050565b6000602082840312156124a5576124a4611b6d565b5b60006124b38482850161247a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006124f682611f2e565b915061250183611f2e565b925082820261250f81611f2e565b91508282048414831517612526576125256124bc565b5b5092915050565b600061253882611f2e565b915061254383611f2e565b925082820190508082111561255b5761255a6124bc565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006125ca82611f2e565b9150600082036125dd576125dc6124bc565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061261e602083612090565b9150612629826125e8565b602082019050919050565b6000602082019050818103600083015261264d81612611565b9050919050565b6000819050919050565b61266f61266a82611cbd565b612654565b82525050565b6000612681828561265e565b602082019150612691828461265e565b6020820191508190509392505050565b60006126ac82611f2e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036126de576126dd6124bc565b5b60018201905091905056fea26469706673582212204bbdde98354ad180d3de51b3908e21fa84608db45f7f67966923d4bd8e776bae64736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
UpgradeMintingModule.sol 153 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
error AddressAlreadyMinted();
error ProofInvalidOrNotInAllowlist();
error PublicMintingDisabled();
error AllowlistMintingDisabled();
error NotEnoughEth();
error TransferFailed();
error InvalidTreasury();
error InvalidVersion();
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
interface IPassport {
function mintPassport(address to) external returns (uint256);
}
interface HashingModule {
function storeTokenHash(uint256 tokenId) external;
}
interface LegacyMintingModule {
function minted(address minter) external returns (bool);
}
contract UpgradeMintingModule is AccessControl, ReentrancyGuard {
bytes32 public merkleRoot;
uint256 public fee;
uint256 public allowlistFee;
IPassport public decagon;
HashingModule public hashingModule;
LegacyMintingModule public mintingModuleV1;
LegacyMintingModule public mintingModuleV2;
address payable public treasury;
bool public publicMintEnabled;
bool public allowlistMintEnabled;
bool public oneMintPerAddress;
mapping(address => bool) public minted;
event PublicMintToggled();
event AllowlistMintToggled();
event OneMintPerAddressToggled();
event MerkleRootSet(bytes32 indexed newMerkleRoot);
event HashingModuleSet(address indexed newHashingModule);
event LegacyMintingModuleSet(address indexed mintingModule);
event PublicFeeSet(uint256 indexed newFee);
event AllowlistFeeSet(uint256 indexed newAllowlistFee);
event TreasuryAddressSet(address indexed newTreasuryAddress);
// new mint event
event DecagonMinted(uint256 indexed tokenId, address indexed minter);
constructor(
address decagonContractAddress,
address _hashingModule,
address _mintingModuleV1,
address _mintingModuleV2,
uint256 _fee,
uint256 _allowlistFee,
address payable _treasury
) {
if (_treasury == address(0)) revert InvalidTreasury();
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
decagon = IPassport(decagonContractAddress);
hashingModule = HashingModule(_hashingModule);
mintingModuleV1 = LegacyMintingModule(_mintingModuleV1);
mintingModuleV2 = LegacyMintingModule(_mintingModuleV2);
publicMintEnabled = false;
allowlistMintEnabled = false;
fee = _fee;
allowlistFee = _allowlistFee;
treasury = _treasury;
oneMintPerAddress = true;
}
function mintDecagon() external payable nonReentrant {
if (!publicMintEnabled) revert PublicMintingDisabled();
if (msg.value < fee) revert NotEnoughEth();
_mint();
}
function mintAllowlistedDecagon(bytes32[] calldata _merkleProof) external payable nonReentrant {
if (!allowlistMintEnabled) revert AllowlistMintingDisabled();
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
if (!MerkleProof.verify(_merkleProof, merkleRoot, leaf)) revert ProofInvalidOrNotInAllowlist();
if (msg.value < allowlistFee) revert NotEnoughEth();
_mint();
}
function _mint() internal {
if (oneMintPerAddress && (minted[msg.sender] || mintingModuleV1.minted(msg.sender) || mintingModuleV2.minted(msg.sender))) revert AddressAlreadyMinted();
minted[msg.sender] = true;
(bool sentTreasury, ) = treasury.call{value: msg.value}("");
if (!sentTreasury) revert TransferFailed();
uint256 tokenId = decagon.mintPassport(msg.sender);
emit DecagonMinted(tokenId, msg.sender);
hashingModule.storeTokenHash(tokenId);
}
function setMerkleRoot(bytes32 merkleRoot_) external onlyRole(DEFAULT_ADMIN_ROLE) {
merkleRoot = merkleRoot_;
emit MerkleRootSet(merkleRoot_);
}
function setHashingModule(address _hashingModule) external onlyRole(DEFAULT_ADMIN_ROLE) {
hashingModule = HashingModule(_hashingModule);
emit HashingModuleSet(_hashingModule);
}
function setLegacyMintingModule(address _mintingModule, uint256 _version) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_version == 1) mintingModuleV1 = LegacyMintingModule(_mintingModule);
else if (_version == 2) mintingModuleV2 = LegacyMintingModule(_mintingModule);
else revert InvalidVersion();
emit LegacyMintingModuleSet(_mintingModule);
}
function toggleOneMintPerAddress() external onlyRole(DEFAULT_ADMIN_ROLE) {
oneMintPerAddress = !oneMintPerAddress;
emit OneMintPerAddressToggled();
}
function togglePublicMintEnabled() external onlyRole(DEFAULT_ADMIN_ROLE) {
publicMintEnabled = !publicMintEnabled;
emit PublicMintToggled();
}
function toggleAllowlistMintEnabled() external onlyRole(DEFAULT_ADMIN_ROLE) {
allowlistMintEnabled = !allowlistMintEnabled;
emit AllowlistMintToggled();
}
function setFee(uint256 newFee) external onlyRole(DEFAULT_ADMIN_ROLE) {
fee = newFee;
emit PublicFeeSet(newFee);
}
function setAllowlistFee(uint256 newAllowlistFee) external onlyRole(DEFAULT_ADMIN_ROLE) {
allowlistFee = newAllowlistFee;
emit AllowlistFeeSet(newAllowlistFee);
}
function setTreasury(address payable _newTreasury) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_newTreasury == address(0)) revert InvalidTreasury();
treasury = _newTreasury;
emit TreasuryAddressSet(_newTreasury);
}
}
AccessControl.sol 223 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
MerkleProof.sol 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
IAccessControl.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
allowlistFee 0xdc763cb5 → uint256
allowlistMintEnabled 0x79de186a → bool
decagon 0xbef9ec74 → address
fee 0xddca3f43 → uint256
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
hashingModule 0x2a215843 → address
merkleRoot 0x2eb4a7ab → bytes32
minted 0x1e7269c5 → bool
mintingModuleV1 0xcaa52e8d → address
mintingModuleV2 0x55c96b99 → address
oneMintPerAddress 0xd8f858a7 → bool
publicMintEnabled 0x0f4161aa → bool
supportsInterface 0x01ffc9a7 → bool
treasury 0x61d027b3 → address
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
grantRole 0x2f2ff15d
bytes32 role
address account
mintAllowlistedDecagon 0x3779147e
bytes32[] _merkleProof
mintDecagon 0x9222f413
No parameters
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
setAllowlistFee 0xaa53bcbc
uint256 newAllowlistFee
setFee 0x69fe0e2d
uint256 newFee
setHashingModule 0xe5a87614
address _hashingModule
setLegacyMintingModule 0xa785af83
address _mintingModule
uint256 _version
setMerkleRoot 0x7cb64759
bytes32 merkleRoot_
setTreasury 0xf0f44260
address _newTreasury
toggleAllowlistMintEnabled 0x8efe3414
No parameters
toggleOneMintPerAddress 0x39c72af9
No parameters
togglePublicMintEnabled 0x6d79c162
No parameters
Recent Transactions
No transactions found for this address