Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x99AC1745f94fD1533C7cC8f9bC1C39E649dcecbB
Balance 0 ETH
Nonce 1
Code Size 17845 bytes
Indexed Transactions 0 (1 on-chain, 1.4% indexed)
External Etherscan · Sourcify

Contract Bytecode

17845 bytes
0x6080604052600436106102695760003560e01c806353438e1b116101535780639b6860c8116100cb578063e985e9c51161007f578063f2fde38b11610064578063f2fde38b1461076b578063f3fef3a31461078b578063fc1a1c36146107ab57600080fd5b8063e985e9c5146106f5578063f242432a1461074b57600080fd5b8063af933d1e116100b0578063af933d1e14610695578063c6eb8da8146106b5578063dae42360146106d557600080fd5b80639b6860c814610659578063a22cb4651461067557600080fd5b80637aff2667116101225780638ef535b9116101075780638ef535b9146105eb578063932c4916146105fe57806395d89b411461064457600080fd5b80637aff2667146105ab5780638da5cb5b146105c057600080fd5b806353438e1b146105225780635997bbee1461053a5780636a66fcf414610580578063715018a61461059657600080fd5b80632a55205a116101e65780633a5381b5116101b557806348edef5b1161019a57806348edef5b146104c05780634b09b72a146104e05780634e1273f4146104f557600080fd5b80633a5381b51461047357806344004cc1146104a057600080fd5b80632a55205a146103cf5780632bb1a91a1461041b5780632c24db3a146104335780632eb2c2d61461045357600080fd5b80630e89341c1161023d5780631684f079116102225780631684f0791461035557806318160ddd146103685780631ed203471461037d57600080fd5b80630e89341c146103155780631327d3d81461033557600080fd5b8062fdd58e1461026e57806301ffc9a7146102a157806302fe5305146102d157806306fdde03146102f3575b600080fd5b34801561027a57600080fd5b5061028e610289366004613a87565b6107c7565b6040519081526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc366004613ae1565b6108a4565b6040519015158152602001610298565b3480156102dd57600080fd5b506102f16102ec366004613c0a565b6108b5565b005b3480156102ff57600080fd5b50610308610942565b6040516102989190613cbd565b34801561032157600080fd5b50610308610330366004613cd0565b6109d0565b34801561034157600080fd5b506102f1610350366004613ce9565b610a64565b6102f1610363366004613d06565b610bd2565b34801561037457600080fd5b5060085461028e565b34801561038957600080fd5b50600c546103aa9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610298565b3480156103db57600080fd5b506103ef6103ea366004613d5f565b61101d565b6040805173ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915201610298565b34801561042757600080fd5b5061028e63629754c081565b34801561043f57600080fd5b506102f161044e366004613e16565b611067565b34801561045f57600080fd5b506102f161046e366004613ee3565b6111b2565b34801561047f57600080fd5b50600b546103aa9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156104ac57600080fd5b506102f16104bb366004613f91565b61127b565b3480156104cc57600080fd5b506102f16104db366004613ce9565b61131d565b3480156104ec57600080fd5b5061028e601e81565b34801561050157600080fd5b50610515610510366004613e16565b61148b565b604051610298919061400d565b34801561052e57600080fd5b5061028e6362a483c081565b34801561054657600080fd5b506102c1610555366004613ce9565b73ffffffffffffffffffffffffffffffffffffffff166000908152600e602052604090205460ff1690565b34801561058c57600080fd5b5061028e600d5481565b3480156105a257600080fd5b506102f16115e3565b3480156105b757600080fd5b5061028e611670565b3480156105cc57600080fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff166103aa565b6102f16105f9366004613ce9565b611687565b34801561060a57600080fd5b506102c1610619366004613ce9565b73ffffffffffffffffffffffffffffffffffffffff166000908152600f602052604090205460ff1690565b34801561065057600080fd5b506103086119f5565b34801561066557600080fd5b5061028e6702c68af0bb14000081565b34801561068157600080fd5b506102f161069036600461402e565b611a02565b3480156106a157600080fd5b506102f16106b0366004614067565b611a11565b3480156106c157600080fd5b506102f16106d03660046140ad565b611af7565b3480156106e157600080fd5b506102f16106f0366004613cd0565b611b68565b34801561070157600080fd5b506102c161071036600461412f565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561075757600080fd5b506102f161076636600461415d565b611bee565b34801561077757600080fd5b506102f1610786366004613ce9565b611cb0565b34801561079757600080fd5b506102f16107a6366004613a87565b611ddd565b3480156107b757600080fd5b5061028e67011c37937e08000081565b600073ffffffffffffffffffffffffffffffffffffffff8316610871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526020818152604080832073ffffffffffffffffffffffffffffffffffffffff949094168352929052205490565b60006108af82611ea7565b92915050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b61093f81611efd565b50565b6005805461094f906141c6565b80601f016020809104026020016040519081016040528092919081815260200182805461097b906141c6565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050505081565b6060600280546109df906141c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0b906141c6565b8015610a585780601f10610a2d57610100808354040283529160200191610a58565b820191906000526020600020905b815481529060010190602001808311610a3b57829003601f168201915b50505050509050919050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610ae5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b73ffffffffffffffffffffffffffffffffffffffff811615801590610b255750600b5473ffffffffffffffffffffffffffffffffffffffff828116911614155b610b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f696e76616c6964206e657756616c696461746f722061646472657373210000006044820152606401610868565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60026009541415610c3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610868565b600260095563629754c0421015610cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f574c204d696e74206973204e6f742073746172742100000000000000000000006044820152606401610868565b81600010610d1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f6d696e7420616d6f756e74206d757374203e20302100000000000000000000006044820152606401610868565b6002821115610d87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f6d696e7420636f756e7420657863656564206d617820616c6c6f7720320000006044820152606401610868565b610d918382611a11565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600e602052604090205460ff1615610e47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f416464726573732068616420616c7265616479206d696e74656420696e20776860448201527f6974656c697374210000000000000000000000000000000000000000000000006064820152608401610868565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600e6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610ea78367011c37937e080000614249565b9050803414610f12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e636f7272656374207061796d656e742076616c75650000000000000000006044820152606401610868565b600c5460405173ffffffffffffffffffffffffffffffffffffffff9091169082156108fc029083906000818181858888f19350505050158015610f59573d6000803e3d6000fd5b50610f62611670565b610f8c907f000000000000000000000000000000000000000000000000000000000000020c614286565b83610f9660085490565b610fa0919061429d565b1115611008576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4d696e7420636f756e74206578636565646564206d617820616c6c6f772100006044820152606401610868565b6110128484611f10565b505060016009555050565b600354600454600091829173ffffffffffffffffffffffffffffffffffffffff90911690620f424090611051908690614249565b61105b91906142b5565b915091505b9250929050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146110e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b8051825114611153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f746f7320616e6420616d6f756e7473206c656e677468206d69736d61746368006044820152606401610868565b60005b82518110156111ad5761119b838281518110611174576111746142f0565b602002602001015183838151811061118e5761118e6142f0565b6020026020010151611f10565b806111a58161431f565b915050611156565b505050565b73ffffffffffffffffffffffffffffffffffffffff85163314806111db57506111db8533610710565b611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610868565b61127485858585856120cc565b5050505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146112fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b6111ad73ffffffffffffffffffffffffffffffffffffffff84168383612406565b600a5473ffffffffffffffffffffffffffffffffffffffff16331461139e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b73ffffffffffffffffffffffffffffffffffffffff8116158015906113de5750600c5473ffffffffffffffffffffffffffffffffffffffff828116911614155b611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f696e76616c6964206e657743464f2061646472657373210000000000000000006044820152606401610868565b600c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060815183511461151e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610868565b6000835167ffffffffffffffff81111561153a5761153a613afe565b604051908082528060200260200182016040528015611563578160200160208202803683370190505b50905060005b84518110156115db576115ae858281518110611587576115876142f0565b60200260200101518583815181106115a1576115a16142f0565b60200260200101516107c7565b8282815181106115c0576115c06142f0565b60209081029190910101526115d48161431f565b9050611569565b509392505050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611664576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b61166e6000612493565b565b6000600d5442106116815750600090565b50601e90565b600260095414156116f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610868565b60026009556362a483c0421015611767576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f5075626c69632053616c65204d696e74206973204e6f742073746172742100006044820152606401610868565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600f602052604090205460ff161561181d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f416464726573732068616420616c7265616479206d696e74656420696e20707560448201527f626c69632073616c6521000000000000000000000000000000000000000000006064820152608401610868565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600f6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915590611881826702c68af0bb140000614249565b90508034146118ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e636f7272656374207061796d656e742076616c75650000000000000000006044820152606401610868565b600c5460405173ffffffffffffffffffffffffffffffffffffffff9091169082156108fc029083906000818181858888f19350505050158015611933573d6000803e3d6000fd5b5061193c611670565b611966907f000000000000000000000000000000000000000000000000000000000000020c614286565b8261197060085490565b61197a919061429d565b11156119e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4d696e7420636f756e74206578636565646564206d617820616c6c6f772100006044820152606401610868565b6119eb8361250a565b5050600160095550565b6006805461094f906141c6565b611a0d3383836125cb565b5050565b60408051606084901b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602080830191909152825160148184030181526034830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006054840152607080840182905284518085039091018152609090930190935281519101206111ad908390600b5460408051808201909152601781527f696e76616c69642076616c696461746f72207369676e21000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff909116905b8173ffffffffffffffffffffffffffffffffffffffff16611b18848661271f565b73ffffffffffffffffffffffffffffffffffffffff16148190611274576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108689190613cbd565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611be9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b600d55565b73ffffffffffffffffffffffffffffffffffffffff8516331480611c175750611c178533610710565b611ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f76656400000000000000000000000000000000000000000000006064820152608401610868565b611274858585858561273b565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611d31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b73ffffffffffffffffffffffffffffffffffffffff8116611dd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610868565b61093f81612493565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611e5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610868565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f193505050501580156111ad573d6000803e3d6000fd5b3b151590565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a0000000000000000000000000000000000000000000000000000000014806108af57506108af82612975565b8051611a0d9060029060208401906139cc565b7f000000000000000000000000000000000000000000000000000000000000020c81611f3b60085490565b611f45919061429d565b1115611fad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f22746f74616c537570706c7920657863656564206d6178537570706c792100006044820152606401610868565b60008167ffffffffffffffff811115611fc857611fc8613afe565b604051908082528060200260200182016040528015611ff1578160200160208202803683370190505b50905060008267ffffffffffffffff81111561200f5761200f613afe565b604051908082528060200260200182016040528015612038578160200160208202803683370190505b50905060005b838110156120aa5760085461205490600161429d565b6008819055835184908390811061206d5761206d6142f0565b602002602001018181525050600182828151811061208d5761208d6142f0565b6020908102919091010152806120a28161431f565b91505061203e565b506120c684838360405180602001604052806000815250612a58565b50505050565b815183511461215d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610868565b73ffffffffffffffffffffffffffffffffffffffff8416612200576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610868565b3360005b8451811015612371576000858281518110612221576122216142f0565b60200260200101519050600085838151811061223f5761223f6142f0565b6020908102919091018101516000848152808352604080822073ffffffffffffffffffffffffffffffffffffffff8e16835290935291909120549091508181101561230c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610868565b60008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8e8116855292528083208585039055908b1682528120805484929061235690849061429d565b925050819055505050508061236a9061431f565b9050612204565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516123e8929190614358565b60405180910390a46123fe818787878787612ccd565b505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526111ad908490612f58565b600a805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60085461251890600161429d565b6008557f000000000000000000000000000000000000000000000000000000000000020c61254560085490565b11156125ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f22746f74616c537570706c7920657863656564206d6178537570706c792100006044820152606401610868565b61093f81600854600160405180602001604052806000815250613064565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610868565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600080600061272e85856131c2565b915091506115db8161322f565b73ffffffffffffffffffffffffffffffffffffffff84166127de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610868565b336127f78187876127ee88613488565b61127488613488565b60008481526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8a168452909152902054838110156128b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610868565b60008581526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8b81168552925280832087850390559088168252812080548692906128ff90849061429d565b9091555050604080518681526020810186905273ffffffffffffffffffffffffffffffffffffffff808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461296c8288888888886134d3565b50505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a26000000000000000000000000000000000000000000000000000000001480612a0857507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b806108af57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146108af565b73ffffffffffffffffffffffffffffffffffffffff8416612afb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610868565b8151835114612b8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610868565b3360005b8451811015612c4257838181518110612bab57612bab6142f0565b6020026020010151600080878481518110612bc857612bc86142f0565b6020026020010151815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612c2a919061429d565b90915550819050612c3a8161431f565b915050612b90565b508473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612cba929190614358565b60405180910390a4611274816000878787875b73ffffffffffffffffffffffffffffffffffffffff84163b156123fe576040517fbc197c8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063bc197c8190612d449089908990889088908890600401614386565b6020604051808303816000875af1925050508015612d9d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612d9a918101906143f1565b60015b612e8757612da961440e565b806308c379a01415612dfd5750612dbe61442a565b80612dc95750612dff565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108689190613cbd565b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610868565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c81000000000000000000000000000000000000000000000000000000001461296c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610868565b6000612fba826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166136809092919063ffffffff16565b8051909150156111ad5780806020019051810190612fd891906144d2565b6111ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610868565b73ffffffffffffffffffffffffffffffffffffffff8416613107576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610868565b33613118816000876127ee88613488565b60008481526020818152604080832073ffffffffffffffffffffffffffffffffffffffff891684529091528120805485929061315590849061429d565b9091555050604080518581526020810185905273ffffffffffffffffffffffffffffffffffffffff80881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611274816000878787876134d3565b6000808251604114156131f95760208301516040840151606085015160001a6131ed87828585613699565b94509450505050611060565b82516040141561322357602083015160408401516132188683836137b1565b935093505050611060565b50600090506002611060565b6000816004811115613243576132436144ef565b141561324c5750565b6001816004811115613260576132606144ef565b14156132c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610868565b60028160048111156132dc576132dc6144ef565b1415613344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610868565b6003816004811115613358576133586144ef565b14156133e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610868565b60048160048111156133fa576133fa6144ef565b141561093f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610868565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106134c2576134c26142f0565b602090810291909101015292915050565b73ffffffffffffffffffffffffffffffffffffffff84163b156123fe576040517ff23a6e6100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063f23a6e619061354a908990899088908890889060040161451e565b6020604051808303816000875af19250505080156135a3575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526135a0918101906143f1565b60015b6135af57612da961440e565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e61000000000000000000000000000000000000000000000000000000001461296c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610868565b606061368f84846000856137f9565b90505b9392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156136d057506000905060036137a8565b8460ff16601b141580156136e857508460ff16601c14155b156136f957506000905060046137a8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561374d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166137a1576000600192509250506137a8565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b016137eb87828885613699565b935093505050935093915050565b60608247101561388b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610868565b843b6138f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610868565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161391c9190614563565b60006040518083038185875af1925050503d8060008114613959576040519150601f19603f3d011682016040523d82523d6000602084013e61395e565b606091505b509150915061396e828286613979565b979650505050505050565b60608315613988575081613692565b8251156139985782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108689190613cbd565b8280546139d8906141c6565b90600052602060002090601f0160209004810192826139fa5760008555613a40565b82601f10613a1357805160ff1916838001178555613a40565b82800160010185558215613a40579182015b82811115613a40578251825591602001919060010190613a25565b50613a4c929150613a50565b5090565b5b80821115613a4c5760008155600101613a51565b73ffffffffffffffffffffffffffffffffffffffff8116811461093f57600080fd5b60008060408385031215613a9a57600080fd5b8235613aa581613a65565b946020939093013593505050565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461093f57600080fd5b600060208284031215613af357600080fd5b813561369281613ab3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff82111715613b7157613b71613afe565b6040525050565b600082601f830112613b8957600080fd5b813567ffffffffffffffff811115613ba357613ba3613afe565b604051613bd860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160182613b2d565b818152846020838601011115613bed57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215613c1c57600080fd5b813567ffffffffffffffff811115613c3357600080fd5b613c3f84828501613b78565b949350505050565b60005b83811015613c62578181015183820152602001613c4a565b838111156120c65750506000910152565b60008151808452613c8b816020860160208601613c47565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006136926020830184613c73565b600060208284031215613ce257600080fd5b5035919050565b600060208284031215613cfb57600080fd5b813561369281613a65565b600080600060608486031215613d1b57600080fd5b8335613d2681613a65565b925060208401359150604084013567ffffffffffffffff811115613d4957600080fd5b613d5586828701613b78565b9150509250925092565b60008060408385031215613d7257600080fd5b50508035926020909101359150565b600067ffffffffffffffff821115613d9b57613d9b613afe565b5060051b60200190565b600082601f830112613db657600080fd5b81356020613dc382613d81565b604051613dd08282613b2d565b83815260059390931b8501820192828101915086841115613df057600080fd5b8286015b84811015613e0b5780358352918301918301613df4565b509695505050505050565b60008060408385031215613e2957600080fd5b823567ffffffffffffffff80821115613e4157600080fd5b818501915085601f830112613e5557600080fd5b81356020613e6282613d81565b604051613e6f8282613b2d565b83815260059390931b8501820192828101915089841115613e8f57600080fd5b948201945b83861015613eb6578535613ea781613a65565b82529482019490820190613e94565b96505086013592505080821115613ecc57600080fd5b50613ed985828601613da5565b9150509250929050565b600080600080600060a08688031215613efb57600080fd5b8535613f0681613a65565b94506020860135613f1681613a65565b9350604086013567ffffffffffffffff80821115613f3357600080fd5b613f3f89838a01613da5565b94506060880135915080821115613f5557600080fd5b613f6189838a01613da5565b93506080880135915080821115613f7757600080fd5b50613f8488828901613b78565b9150509295509295909350565b600080600060608486031215613fa657600080fd5b8335613fb181613a65565b92506020840135613fc181613a65565b929592945050506040919091013590565b600081518084526020808501945080840160005b8381101561400257815187529582019590820190600101613fe6565b509495945050505050565b6020815260006136926020830184613fd2565b801515811461093f57600080fd5b6000806040838503121561404157600080fd5b823561404c81613a65565b9150602083013561405c81614020565b809150509250929050565b6000806040838503121561407a57600080fd5b823561408581613a65565b9150602083013567ffffffffffffffff8111156140a157600080fd5b613ed985828601613b78565b600080600080608085870312156140c357600080fd5b843567ffffffffffffffff808211156140db57600080fd5b6140e788838901613b78565b9550602087013594506040870135915061410082613a65565b9092506060860135908082111561411657600080fd5b5061412387828801613b78565b91505092959194509250565b6000806040838503121561414257600080fd5b823561414d81613a65565b9150602083013561405c81613a65565b600080600080600060a0868803121561417557600080fd5b853561418081613a65565b9450602086013561419081613a65565b93506040860135925060608601359150608086013567ffffffffffffffff8111156141ba57600080fd5b613f8488828901613b78565b600181811c908216806141da57607f821691505b60208210811415614214577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142815761428161421a565b500290565b6000828210156142985761429861421a565b500390565b600082198211156142b0576142b061421a565b500190565b6000826142eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143515761435161421a565b5060010190565b60408152600061436b6040830185613fd2565b828103602084015261437d8185613fd2565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a060408301526143bf60a0830186613fd2565b82810360608401526143d18186613fd2565b905082810360808401526143e58185613c73565b98975050505050505050565b60006020828403121561440357600080fd5b815161369281613ab3565b600060033d11156144275760046000803e5060005160e01c5b90565b600060443d10156144385790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561448657505050505090565b828501915081518181111561449e5750505050505090565b843d87010160208285010111156144b85750505050505090565b6144c760208286010187613b2d565b509095945050505050565b6000602082840312156144e457600080fd5b815161369281614020565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015283606083015260a0608083015261396e60a0830184613c73565b60008251614575818460208701613c47565b919091019291505056fea2646970667358221220a28dda5fbb32344e2b8fe8b16377bb92e4a915848001c28a4f23de2dde045ece64736f6c634300080b0033

Verified Source Code Partial Match

Compiler: v0.8.11+commit.d7f03943 EVM: istanbul Optimization: Yes (1000000 runs)
ERC2981Base.sol 24 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "ERC165.sol";

import "IERC2981Royalties.sol";

/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
abstract contract ERC2981Base is ERC165, IERC2981Royalties {
    

    /// @inheritdoc	ERC165
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IERC2981Royalties).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}
IERC2981Royalties.sol 19 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IERC2981Royalties
/// @dev Interface for the ERC2981 - Token Royalty standard
interface IERC2981Royalties {
    struct RoyaltyInfo {
        address recipient;
        uint256 royalAmount;
    }

     function royaltyInfo(
        uint256 _tokenId,
        uint256 _salePrice
    ) external view returns (
        address receiver,
        uint256 royaltyAmount
    );
}
TakeOff.sol 24 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "ReentrancyGuard.sol";
import "ECDSA.sol";
import "SafeERC20.sol";

import "BCANFT1155Base.sol";
import "TakeOffBase.sol";

contract TakeOff is TakeOffBase {

    constructor(string memory name, string memory symbol, uint256 maxSupply, string memory uri,
        RoyaltyInfo memory royaltyInfo,
        address validator_,
        address[] memory tos,
        uint256[] memory amounts
    )

    TakeOffBase(name, symbol, maxSupply, uri, royaltyInfo, validator_) {
        airdropMintTo(tos, amounts);
    }
}
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;
    }
}
ECDSA.sol 234 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}
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);
    }
}
SafeERC20.sol 99 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";
import "Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
BCANFT1155Base.sol 54 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "ERC1155.sol";
import "Context.sol";
import "Counters.sol";
import "ECDSA.sol";
import "Ownable.sol";
import "ERC2981PerTokenRoyalties.sol";


contract BCANFT1155Base is ERC1155, ERC2981PerTokenRoyalties {
    string public name;
    string public symbol;
    string private _uri;
    uint256 immutable maxSupply;
    uint256 private currentIndex = 0;

    constructor(string memory name_, string memory symbol_, uint256 maxSupply_, string memory uri_, RoyaltyInfo memory royaltyInfo) ERC1155(uri_) {
        name = name_;
        symbol = symbol_;
        _uri = uri_;
        maxSupply = maxSupply_;
        _setTokenRoyalty(royaltyInfo);
    }

    function mintTo(address to) internal virtual {
        currentIndex = currentIndex + 1;
        require(totalSupply() <= maxSupply, '"totalSupply exceed maxSupply!');
        _mint(to, currentIndex, 1, '');
    }

    function mintBatch(address to, uint256 amount) internal virtual {
        require(totalSupply() + amount <= maxSupply, '"totalSupply exceed maxSupply!');

        uint256[] memory ids = new uint256[](amount);
        uint256[] memory amounts = new uint256[](amount);
        for (uint256 i = 0; i < amount; i++) {
            currentIndex = currentIndex + 1;
            ids[i] = currentIndex;
            amounts[i] = 1;
        }
        _mintBatch(to, ids, amounts, '');
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC2981Base) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function totalSupply() public view virtual returns (uint256) {
        return currentIndex;
    }
}
ERC1155.sol 464 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "IERC1155.sol";
import "IERC1155Receiver.sol";
import "IERC1155MetadataURI.sol";
import "Address.sol";
import "Context.sol";
import "ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC1155).interfaceId ||
            interfaceId == type(IERC1155MetadataURI).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

import "IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}
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);
}
IERC1155Receiver.sol 53 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}
IERC1155MetadataURI.sol 22 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}
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;
    }
}
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;
    }
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
ERC2981PerTokenRoyalties.sol 29 lines
// SPDX-License-Identifier: MIT
// https://github.com/dievardump/EIP2981-implementation/blob/main/contracts/ERC2981PerTokenRoyalties.sol
pragma solidity ^0.8.0;

import "ERC165.sol";

import "ERC2981Base.sol";

/// @dev This is a contract used to add ERC2981 support to ERC721 and 1155
abstract contract ERC2981PerTokenRoyalties is ERC2981Base {

    RoyaltyInfo _royaltyInfo;

    /// @dev Sets token royalties
    /// @param royaltyInfo.recipient recipient of the royalties
    /// @param royaltyInfo.royalAmount percentage (using 4 decimals - 1000000 = 100, 0 = 0)
    function _setTokenRoyalty(RoyaltyInfo memory royaltyInfo) internal {
        //PercentBase = 1e6, so 1e6 : 100% Percent
        require(royaltyInfo.royalAmount <= 1e6, 'ERC2981Royalties: Too high');
        _royaltyInfo = royaltyInfo;
//        _royaltyInfo = RoyaltyInfo(recipient, value);
    }

    function royaltyInfo(uint256 tokenId, uint256 value) external view override
    returns (address receiver, uint256 royaltyAmount) {
        //PercentBase = 1e6
        return (_royaltyInfo.recipient, _royaltyInfo.royalAmount * value / 1e6);
    }
}
TakeOffBase.sol 135 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "ReentrancyGuard.sol";
import "ECDSA.sol";
import "SafeERC20.sol";

import "BCANFT1155Base.sol";

contract TakeOffBase is BCANFT1155Base, ReentrancyGuard, Ownable {
    using Strings for uint256;
    using SafeERC20 for IERC20;

    address public validator;
    address public cfo = address(0xba6c9562A0a7d482267E07999CF6968064a8e7de);

    uint256 public constant whitelistMintStartTime = 1654084800; //2022-06-01 20:00+GMT8
    uint256 public constant publicSaleMintStartTime = 1654948800; //2022-06-11 20:00+GMT8

    uint256 public constant whitelistPrice = 8e16; //0.08 ETH
    uint256 public constant publicSalePrice = 2e17; //0.2 ETH

    uint256 public constant reserveAmount = 30;
    uint256 public reserveEndTime = 1655208000; //2022-06-14 20:00+GMT8

    //    userAddress _isWhitelistMinted
    mapping(address => bool) _isWhitelistMinted;
    //    userAddress _isPublicSaleMinted
    mapping(address => bool) _isPublicSaleMinted;

    /**
        @dev
        @param _maxSupply
    */
    constructor(string memory name_, string memory symbol_, uint256 maxSupply_, string memory uri,
        RoyaltyInfo memory royaltyInfo,
        address validator_)
    BCANFT1155Base(name_, symbol_, maxSupply_, uri, royaltyInfo) {
        validator = validator_;
    }

    function publicMintTo(address to) public payable nonReentrant {
        require(block.timestamp >= publicSaleMintStartTime, "Public Sale Mint is Not start!");
        require(!_isPublicSaleMinted[to], "Address had already minted in public sale!");
        _isPublicSaleMinted[to] = true;

        uint256 amount = 1;
        uint256 paymentAmount = publicSalePrice * amount;
        require(msg.value == paymentAmount, "Incorrect payment value");
        payable(cfo).transfer(paymentAmount);

        require(totalSupply() + amount <= maxSupply - getReserveAmount(), "Mint count exceeded max allow!");
        mintTo(to);
    }

    function getReserveAmount() public view returns (uint256) {
        if (block.timestamp >= reserveEndTime) {
            return 0;
        }
        return reserveAmount;
    }

    function updateReserveEndTime(uint256 newReserveEndTime) public onlyOwner {
        reserveEndTime = newReserveEndTime;
    }

    function whiteListMintTo(address to, uint256 amount, bytes memory validatorSig) public payable nonReentrant {
        require(block.timestamp >= whitelistMintStartTime, "WL Mint is Not start!");
        require(0 < amount, "mint amount must > 0!");
        require(amount <= 2, "mint count exceed max allow 2");
        checkWhitelistMintValidator(to, validatorSig);
        require(!_isWhitelistMinted[to], "Address had already minted in whitelist!");
        _isWhitelistMinted[to] = true;
        uint256 paymentAmount = whitelistPrice * amount;
        require(msg.value == paymentAmount, "Incorrect payment value");
        payable(cfo).transfer(paymentAmount);
        require(totalSupply() + amount <= maxSupply - getReserveAmount(), "Mint count exceeded max allow!");

        mintBatch(to, amount);
    }

    /**
       @dev airdropMintTo
    */
    function airdropMintTo(address[] memory tos, uint256[] memory amounts) public onlyOwner {
        require(tos.length == amounts.length, "tos and amounts length mismatch");

        for (uint256 i = 0; i < tos.length; i++) {
            mintBatch(tos[i], amounts[i]);
        }
    }

    function isWhitelistMinted(address userAddress) public view returns (bool isMinted){
        return _isWhitelistMinted[userAddress];
    }

    function isPublicSaleMinted(address userAddress) public view returns (bool isMinted){
        return _isPublicSaleMinted[userAddress];
    }

    function checkWhitelistMintValidator(address mintToAddress, bytes memory validatorSig) public view {
        bytes32 validatorHash = keccak256(abi.encodePacked(mintToAddress));
        checkSign(validatorSig, ECDSA.toEthSignedMessageHash(validatorHash), validator, "invalid validator sign!");
    }

    function setValidator(address newValidator) external onlyOwner {
        require(newValidator != address(0) && validator != newValidator, "invalid newValidator address!");
        validator = newValidator;
    }

    function setCFOAddress(address newCFO) public onlyOwner {
        require(newCFO != address(0) && cfo != newCFO, "invalid newCFO address!");
        cfo = newCFO;
    }

    function checkSign(bytes memory sign, bytes32 hashCode, address signer, string memory words) public pure {
        require(ECDSA.recover(hashCode, sign) == signer, words);
    }

    /**
        In case money get Stuck in the contract
    */
    function withdraw(address payable to, uint256 amount) external onlyOwner {
        to.transfer(amount);
    }

    function withdrawERC20(address erc20Address, address to, uint256 amount) external onlyOwner {
        IERC20(erc20Address).safeTransfer(to, amount);
    }

    function setURI(string memory newuri) public virtual onlyOwner {
        _setURI(newuri);
    }
}

Read Contract

balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
cfo 0x1ed20347 → address
checkSign 0xc6eb8da8
checkWhitelistMintValidator 0xaf933d1e
getReserveAmount 0x7aff2667 → uint256
isApprovedForAll 0xe985e9c5 → bool
isPublicSaleMinted 0x932c4916 → bool
isWhitelistMinted 0x5997bbee → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
publicSaleMintStartTime 0x53438e1b → uint256
publicSalePrice 0x9b6860c8 → uint256
reserveAmount 0x4b09b72a → uint256
reserveEndTime 0x6a66fcf4 → uint256
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uri 0x0e89341c → string
validator 0x3a5381b5 → address
whitelistMintStartTime 0x2bb1a91a → uint256
whitelistPrice 0xfc1a1c36 → uint256

Write Contract 14 functions

These functions modify contract state and require a wallet transaction to execute.

airdropMintTo 0x2c24db3a
address[] tos
uint256[] amounts
publicMintTo 0x8ef535b9
address to
renounceOwnership 0x715018a6
No parameters
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setCFOAddress 0x48edef5b
address newCFO
setURI 0x02fe5305
string newuri
setValidator 0x1327d3d8
address newValidator
transferOwnership 0xf2fde38b
address newOwner
updateReserveEndTime 0xdae42360
uint256 newReserveEndTime
whiteListMintTo 0x1684f079
address to
uint256 amount
bytes validatorSig
withdraw 0xf3fef3a3
address to
uint256 amount
withdrawERC20 0x44004cc1
address erc20Address
address to
uint256 amount

Recent Transactions

This address has 1 on-chain transactions, but only 1.4% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →