Forkchoice Ethereum Mainnet

Address Contract Partially Verified

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

Contract Bytecode

22740 bytes
0x60806040526004361061025c5760003560e01c80634866b7b011610144578063a996d6ce116100b6578063c87b56dd1161007a578063c87b56dd146108ad578063e4623c1b146108ea578063e985e9c514610913578063ef519cfd14610950578063f2fde38b1461096c578063f33063e5146109955761025c565b8063a996d6ce146107cc578063aa5e23c0146107f5578063b88d4fde1461081e578063beb6589314610847578063bef870ca146108845761025c565b8063715018a611610108578063715018a6146106e25780638da5cb5b146106f957806391b7f5ed1461072457806395d89b411461074d578063a035b1fe14610778578063a22cb465146107a35761025c565b80634866b7b0146105ed57806355f804b3146106165780636352211e1461063f5780636c19e7831461067c57806370a08231146106a55761025c565b8063238ac933116101dd5780632e6cebe5116101a15780632e6cebe5146104f15780633e28350b1461051a578063413185f21461054357806342842e0e1461056e578063432d2e4c1461059757806344c6b6ed146105c25761025c565b8063238ac9331461042d57806323b872dd1461045857806327810b6e146104815780632cc82655146104ac5780632db11544146104d55761025c565b806306fdde031161022457806306fdde0314610348578063081812fc14610373578063095ea7b3146103b057806318160ddd146103d9578063200ce872146104045761025c565b80630188a09d1461026157806301f569971461028c57806301ffc9a7146102b7578063033b8e2d146102f4578063055ad42e1461031d575b600080fd5b34801561026d57600080fd5b506102766109be565b6040516102839190614abf565b60405180910390f35b34801561029857600080fd5b506102a16109d1565b6040516102ae9190614e71565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190614320565b6109d7565b6040516102eb9190614abf565b60405180910390f35b34801561030057600080fd5b5061031b600480360381019061031691906140e7565b610ab9565b005b34801561032957600080fd5b50610332610b79565b60405161033f9190614e71565b60405180910390f35b34801561035457600080fd5b5061035d610b7f565b60405161036a9190614b4f565b60405180910390f35b34801561037f57600080fd5b5061039a600480360381019061039591906143c3565b610c11565b6040516103a79190614a58565b60405180910390f35b3480156103bc57600080fd5b506103d760048036038101906103d2919061426a565b610c8d565b005b3480156103e557600080fd5b506103ee610d92565b6040516103fb9190614e71565b60405180910390f35b34801561041057600080fd5b5061042b600480360381019061042691906142f3565b610da9565b005b34801561043957600080fd5b50610442610e42565b60405161044f9190614a58565b60405180910390f35b34801561046457600080fd5b5061047f600480360381019061047a9190614154565b610e68565b005b34801561048d57600080fd5b50610496610e78565b6040516104a39190614a58565b60405180910390f35b3480156104b857600080fd5b506104d360048036038101906104ce91906143c3565b610e9e565b005b6104ef60048036038101906104ea91906143c3565b610f24565b005b3480156104fd57600080fd5b50610518600480360381019061051391906143c3565b610f7f565b005b34801561052657600080fd5b50610541600480360381019061053c91906142f3565b611005565b005b34801561054f57600080fd5b5061055861109e565b6040516105659190614abf565b60405180910390f35b34801561057a57600080fd5b5061059560048036038101906105909190614154565b6110b1565b005b3480156105a357600080fd5b506105ac6110d1565b6040516105b99190614e71565b60405180910390f35b3480156105ce57600080fd5b506105d76110d6565b6040516105e49190614abf565b60405180910390f35b3480156105f957600080fd5b50610614600480360381019061060f91906142aa565b6110e9565b005b34801561062257600080fd5b5061063d6004803603810190610638919061437a565b6111de565b005b34801561064b57600080fd5b50610666600480360381019061066191906143c3565b611274565b6040516106739190614a58565b60405180910390f35b34801561068857600080fd5b506106a3600480360381019061069e91906140e7565b61128a565b005b3480156106b157600080fd5b506106cc60048036038101906106c791906140e7565b61134a565b6040516106d99190614e71565b60405180910390f35b3480156106ee57600080fd5b506106f761141a565b005b34801561070557600080fd5b5061070e6114a2565b60405161071b9190614a58565b60405180910390f35b34801561073057600080fd5b5061074b600480360381019061074691906143c3565b6114cc565b005b34801561075957600080fd5b50610762611552565b60405161076f9190614b4f565b60405180910390f35b34801561078457600080fd5b5061078d6115e4565b60405161079a9190614e71565b60405180910390f35b3480156107af57600080fd5b506107ca60048036038101906107c5919061422a565b6115ea565b005b3480156107d857600080fd5b506107f360048036038101906107ee91906140e7565b611762565b005b34801561080157600080fd5b5061081c600480360381019061081791906142f3565b611822565b005b34801561082a57600080fd5b50610845600480360381019061084091906141a7565b6118bb565b005b34801561085357600080fd5b5061086e600480360381019061086991906143c3565b611933565b60405161087b9190614abf565b60405180910390f35b34801561089057600080fd5b506108ab60048036038101906108a691906143f0565b611953565b005b3480156108b957600080fd5b506108d460048036038101906108cf91906143c3565b6119dd565b6040516108e19190614b4f565b60405180910390f35b3480156108f657600080fd5b50610911600480360381019061090c91906142aa565b611a7c565b005b34801561091f57600080fd5b5061093a60048036038101906109359190614114565b611b54565b6040516109479190614abf565b60405180910390f35b61096a60048036038101906109659190614430565b611be8565b005b34801561097857600080fd5b50610993600480360381019061098e91906140e7565b611fdb565b005b3480156109a157600080fd5b506109bc60048036038101906109b791906140e7565b6120d3565b005b600f60029054906101000a900460ff1681565b600e5481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aa257507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610ab25750610ab182612193565b5b9050919050565b610ac16121fd565b73ffffffffffffffffffffffffffffffffffffffff16610adf6114a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2c90614d31565b60405180910390fd5b80600f60036101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d5481565b606060028054610b8e9061516f565b80601f0160208091040260200160405190810160405280929190818152602001828054610bba9061516f565b8015610c075780601f10610bdc57610100808354040283529160200191610c07565b820191906000526020600020905b815481529060010190602001808311610bea57829003601f168201915b5050505050905090565b6000610c1c82612205565b610c52576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c9882611274565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d00576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d1f6121fd565b73ffffffffffffffffffffffffffffffffffffffff1614610d8257610d4b81610d466121fd565b611b54565b610d81576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b610d8d838383612253565b505050565b6000610d9c612305565b6001546000540303905090565b610db16121fd565b73ffffffffffffffffffffffffffffffffffffffff16610dcf6114a2565b73ffffffffffffffffffffffffffffffffffffffff1614610e25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1c90614d31565b60405180910390fd5b80600f60016101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e7383838361230f565b505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ea66121fd565b73ffffffffffffffffffffffffffffffffffffffff16610ec46114a2565b73ffffffffffffffffffffffffffffffffffffffff1614610f1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1190614d31565b60405180910390fd5b80600d8190555050565b600f60009054906101000a900460ff16610f73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6a90614d71565b60405180910390fd5b610f7c816127c5565b50565b610f876121fd565b73ffffffffffffffffffffffffffffffffffffffff16610fa56114a2565b73ffffffffffffffffffffffffffffffffffffffff1614610ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff290614d31565b60405180910390fd5b80600e8190555050565b61100d6121fd565b73ffffffffffffffffffffffffffffffffffffffff1661102b6114a2565b73ffffffffffffffffffffffffffffffffffffffff1614611081576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107890614d31565b60405180910390fd5b80600f60006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900460ff1681565b6110cc838383604051806020016040528060008152506118bb565b505050565b606481565b600f60019054906101000a900460ff1681565b600f60029054906101000a900460ff16611138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112f90614e51565b60405180910390fd5b60005b81518110156111da57600082828151811061115957611158615311565b5b602002602001015190503373ffffffffffffffffffffffffffffffffffffffff1661118382611274565b73ffffffffffffffffffffffffffffffffffffffff1614156111cc5760016011600083815260200190815260200160002060006101000a81548160ff0219169083151502179055505b50808060010191505061113b565b5050565b6111e66121fd565b73ffffffffffffffffffffffffffffffffffffffff166112046114a2565b73ffffffffffffffffffffffffffffffffffffffff161461125a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125190614d31565b60405180910390fd5b80600a9080519060200190611270929190613e1a565b5050565b600061127f826128bd565b600001519050919050565b6112926121fd565b73ffffffffffffffffffffffffffffffffffffffff166112b06114a2565b73ffffffffffffffffffffffffffffffffffffffff1614611306576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fd90614d31565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113b2576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff169050919050565b6114226121fd565b73ffffffffffffffffffffffffffffffffffffffff166114406114a2565b73ffffffffffffffffffffffffffffffffffffffff1614611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614d31565b60405180910390fd5b6114a06000612b48565b565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6114d46121fd565b73ffffffffffffffffffffffffffffffffffffffff166114f26114a2565b73ffffffffffffffffffffffffffffffffffffffff1614611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f90614d31565b60405180910390fd5b8060098190555050565b6060600380546115619061516f565b80601f016020809104026020016040519081016040528092919081815260200182805461158d9061516f565b80156115da5780601f106115af576101008083540402835291602001916115da565b820191906000526020600020905b8154815290600101906020018083116115bd57829003601f168201915b5050505050905090565b60095481565b6115f26121fd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611657576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600760006116646121fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166117116121fd565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516117569190614abf565b60405180910390a35050565b61176a6121fd565b73ffffffffffffffffffffffffffffffffffffffff166117886114a2565b73ffffffffffffffffffffffffffffffffffffffff16146117de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d590614d31565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61182a6121fd565b73ffffffffffffffffffffffffffffffffffffffff166118486114a2565b73ffffffffffffffffffffffffffffffffffffffff161461189e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189590614d31565b60405180910390fd5b80600f60026101000a81548160ff02191690831515021790555050565b6118c684848461230f565b6118e58373ffffffffffffffffffffffffffffffffffffffff16612c0e565b1561192d576118f684848484612c21565b61192c576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b60116020528060005260406000206000915054906101000a900460ff1681565b61195b6121fd565b73ffffffffffffffffffffffffffffffffffffffff166119796114a2565b73ffffffffffffffffffffffffffffffffffffffff16146119cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c690614d31565b60405180910390fd5b6119d98183612d81565b5050565b60606119e882612205565b611a1e576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611a28612d9f565b9050600081511415611a495760405180602001604052806000815250611a74565b80611a5384612e31565b604051602001611a6492919061499a565b6040516020818303038152906040525b915050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0390614cd1565b60405180910390fd5b60005b8151811015611b50576000828281518110611b2d57611b2c615311565b5b60200260200101519050611b42816000612f92565b508080600101915050611b0f565b5050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600f60019054906101000a900460ff16611c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2e90614d91565b60405180910390fd5b60008211611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7190614c51565b60405180910390fd5b611c878187878787613382565b611cc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbd90614bd1565b60405180910390fd5b600082611cd23361343b565b611cdc9190614f8d565b90506007600d5411611db85760008711611d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2290614cb1565b60405180910390fd5b600d54871115611d70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6790614c31565b60405180910390fd5b85811115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90614d51565b60405180910390fd5b611fc9565b6000871115611efc576007871115611e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfc90614c31565b60405180910390fd5b6000851115611eb357600d548511611e6a578386611e239190614f8d565b811115611e65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5c90614dd1565b60405180910390fd5b611eae565b85811115611ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea490614e11565b60405180910390fd5b5b611ef7565b85811115611ef6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eed90614d51565b60405180910390fd5b5b611fc8565b60008511611f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3690614cb1565b60405180910390fd5b600d54851115611f84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7b90614db1565b60405180910390fd5b83811115611fc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbe90614c11565b60405180910390fd5b5b5b611fd2836127c5565b50505050505050565b611fe36121fd565b73ffffffffffffffffffffffffffffffffffffffff166120016114a2565b73ffffffffffffffffffffffffffffffffffffffff1614612057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204e90614d31565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120be90614bf1565b60405180910390fd5b6120d081612b48565b50565b6120db6121fd565b73ffffffffffffffffffffffffffffffffffffffff166120f96114a2565b73ffffffffffffffffffffffffffffffffffffffff161461214f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214690614d31565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b600081612210612305565b1115801561221f575060005482105b801561224c575060046000838152602001908152602001600020600001601c9054906101000a900460ff16155b9050919050565b826006600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600061767b905090565b600061231a826128bd565b90508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612385576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff166123a66121fd565b73ffffffffffffffffffffffffffffffffffffffff1614806123d557506123d4856123cf6121fd565b611b54565b5b8061241a57506123e36121fd565b73ffffffffffffffffffffffffffffffffffffffff1661240284610c11565b73ffffffffffffffffffffffffffffffffffffffff16145b905080612453576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156124ba576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6124c785858560016134a5565b6124d360008487612253565b6001600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160392506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506001600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600460008581526020019081526020016000209050848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550428160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060006001850190506000600460008381526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561275357600054821461275257878160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084602001518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b505050828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46127be85858560016134ab565b5050505050565b600e5481111561280a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280190614e31565b60405180910390fd5b612813816134b1565b612852576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284990614d11565b60405180910390fd5b6000816009546128629190615014565b9050803410156128a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289e90614df1565b60405180910390fd5b6128af6134e3565b6128b93383612d81565b5050565b6128c5613ea0565b6000829050806128d3612305565b11612b1157600054811015612b10576000600460008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff16151515158152505090508060400151612b0e57600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16146129f2578092505050612b43565b5b600115612b0d57818060019003925050600460008381526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601c9054906101000a900460ff1615151515815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612b08578092505050612b43565b6129f3565b5b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080823b905060008111915050919050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612c476121fd565b8786866040518563ffffffff1660e01b8152600401612c699493929190614a73565b602060405180830381600087803b158015612c8357600080fd5b505af1925050508015612cb457506040513d601f19601f82011682018060405250810190612cb1919061434d565b60015b612d2e573d8060008114612ce4576040519150601f19603f3d011682016040523d82523d6000602084013e612ce9565b606091505b50600081511415612d26576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b612d9b8282604051806020016040528060008152506136a1565b5050565b6060600a8054612dae9061516f565b80601f0160208091040260200160405190810160405280929190818152602001828054612dda9061516f565b8015612e275780601f10612dfc57610100808354040283529160200191612e27565b820191906000526020600020905b815481529060010190602001808311612e0a57829003601f168201915b5050505050905090565b60606000821415612e79576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612f8d565b600082905060005b60008214612eab578080612e94906151d2565b915050600a82612ea49190614fe3565b9150612e81565b60008167ffffffffffffffff811115612ec757612ec6615340565b5b6040519080825280601f01601f191660200182016040528015612ef95781602001600182028036833780820191505090505b5090505b60008514612f8657600182612f12919061506e565b9150600a85612f219190615253565b6030612f2d9190614f8d565b60f81b818381518110612f4357612f42615311565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612f7f9190614fe3565b9450612efd565b8093505050505b919050565b6000612f9d836128bd565b9050600081600001519050821561307e5760008173ffffffffffffffffffffffffffffffffffffffff16612fcf6121fd565b73ffffffffffffffffffffffffffffffffffffffff161480612ffe5750612ffd82612ff86121fd565b611b54565b5b80613043575061300c6121fd565b73ffffffffffffffffffffffffffffffffffffffff1661302b86610c11565b73ffffffffffffffffffffffffffffffffffffffff16145b90508061307c576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b61308c8160008660016134a5565b61309860008583612253565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060018160000160008282829054906101000a900467ffffffffffffffff160392506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060018160000160108282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600460008781526020019081526020016000209050828160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550428160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600181600001601c6101000a81548160ff02191690831515021790555060006001870190506000600460008381526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156132fc5760005482146132fb57848160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085602001518160000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b5050505083600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461336a8160008660016134ab565b60016000815480929190600101919050555050505050565b600080858585853360405160200161339e9594939291906149f9565b6040516020818303038152906040528051906020012090506000816040516020016133c991906149be565b60405160208183030381529060405280519060200120905061342e8189600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613a639092919063ffffffff16565b9250505095945050505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff169050919050565b50505050565b50505050565b6000808260646134bf610d92565b6134c9919061506e565b6134d39190614f8d565b9050612710811115915050919050565b6000606460553402816134f9576134f86152b3565b5b0490506000600f60039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051613544906149e4565b60006040518083038185875af1925050503d8060008114613581576040519150601f19603f3d011682016040523d82523d6000602084013e613586565b606091505b50509050806135ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135c190614c91565b60405180910390fd5b8134039150601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051613615906149e4565b60006040518083038185875af1925050503d8060008114613652576040519150601f19603f3d011682016040523d82523d6000602084013e613657565b606091505b5050809150508061369d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161369490614b91565b60405180910390fd5b5050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561370e576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000831415613749576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61375660008583866134a5565b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555082600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160088282829054906101000a900467ffffffffffffffff160192506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550836004600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426004600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000819050600084820190506139178673ffffffffffffffffffffffffffffffffffffffff16612c0e565b156139dc575b818673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461398c6000878480600101955087612c21565b6139c2576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80821061391d5782600054146139d757600080fd5b613a47565b5b818060010192508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a48082106139dd575b816000819055505050613a5d60008583866134ab565b50505050565b6000613a6e84612c0e565b15613b54578373ffffffffffffffffffffffffffffffffffffffff16631626ba7e84846040518363ffffffff1660e01b8152600401613aae929190614ada565b60206040518083038186803b158015613ac657600080fd5b505afa925050508015613af757506040513d601f19601f82011682018060405250810190613af4919061434d565b60015b613b045760009050613b8f565b631626ba7e60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613b8f565b8373ffffffffffffffffffffffffffffffffffffffff16613b758484613b96565b73ffffffffffffffffffffffffffffffffffffffff161490505b9392505050565b6000604182511415613bd55760008060006020850151925060408501519150606085015160001a9050613bcb86828585613c45565b9350505050613c3f565b604082511415613c04576000806020840151915060408401519050613bfb858383613dd0565b92505050613c3f565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c3690614bb1565b60405180910390fd5b92915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115613cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ca490614c71565b60405180910390fd5b601b8460ff161480613cc25750601c8460ff16145b613d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cf890614cf1565b60405180910390fd5b600060018686868660405160008152602001604052604051613d269493929190614b0a565b6020604051602081039080840390855afa158015613d48573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613dc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613dbb90614b71565b60405180910390fd5b80915050949350505050565b60008060007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84169150601b8460ff1c019050613e0f86828785613c45565b925050509392505050565b828054613e269061516f565b90600052602060002090601f016020900481019282613e485760008555613e8f565b82601f10613e6157805160ff1916838001178555613e8f565b82800160010185558215613e8f579182015b82811115613e8e578251825591602001919060010190613e73565b5b509050613e9c9190613ee3565b5090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681526020016000151581525090565b5b80821115613efc576000816000905550600101613ee4565b5090565b6000613f13613f0e84614eb1565b614e8c565b90508083825260208201905082856020860282011115613f3657613f35615374565b5b60005b85811015613f665781613f4c88826140d2565b845260208401935060208301925050600181019050613f39565b5050509392505050565b6000613f83613f7e84614edd565b614e8c565b905082815260208101848484011115613f9f57613f9e615379565b5b613faa84828561512d565b509392505050565b6000613fc5613fc084614f0e565b614e8c565b905082815260208101848484011115613fe157613fe0615379565b5b613fec84828561512d565b509392505050565b60008135905061400381615842565b92915050565b600082601f83011261401e5761401d61536f565b5b813561402e848260208601613f00565b91505092915050565b60008135905061404681615859565b92915050565b60008135905061405b81615870565b92915050565b60008151905061407081615870565b92915050565b600082601f83011261408b5761408a61536f565b5b813561409b848260208601613f70565b91505092915050565b600082601f8301126140b9576140b861536f565b5b81356140c9848260208601613fb2565b91505092915050565b6000813590506140e181615887565b92915050565b6000602082840312156140fd576140fc615383565b5b600061410b84828501613ff4565b91505092915050565b6000806040838503121561412b5761412a615383565b5b600061413985828601613ff4565b925050602061414a85828601613ff4565b9150509250929050565b60008060006060848603121561416d5761416c615383565b5b600061417b86828701613ff4565b935050602061418c86828701613ff4565b925050604061419d868287016140d2565b9150509250925092565b600080600080608085870312156141c1576141c0615383565b5b60006141cf87828801613ff4565b94505060206141e087828801613ff4565b93505060406141f1878288016140d2565b925050606085013567ffffffffffffffff8111156142125761421161537e565b5b61421e87828801614076565b91505092959194509250565b6000806040838503121561424157614240615383565b5b600061424f85828601613ff4565b925050602061426085828601614037565b9150509250929050565b6000806040838503121561428157614280615383565b5b600061428f85828601613ff4565b92505060206142a0858286016140d2565b9150509250929050565b6000602082840312156142c0576142bf615383565b5b600082013567ffffffffffffffff8111156142de576142dd61537e565b5b6142ea84828501614009565b91505092915050565b60006020828403121561430957614308615383565b5b600061431784828501614037565b91505092915050565b60006020828403121561433657614335615383565b5b60006143448482850161404c565b91505092915050565b60006020828403121561436357614362615383565b5b600061437184828501614061565b91505092915050565b6000602082840312156143905761438f615383565b5b600082013567ffffffffffffffff8111156143ae576143ad61537e565b5b6143ba848285016140a4565b91505092915050565b6000602082840312156143d9576143d8615383565b5b60006143e7848285016140d2565b91505092915050565b6000806040838503121561440757614406615383565b5b6000614415858286016140d2565b925050602061442685828601613ff4565b9150509250929050565b60008060008060008060c0878903121561444d5761444c615383565b5b600061445b89828a016140d2565b965050602061446c89828a016140d2565b955050604061447d89828a016140d2565b945050606061448e89828a016140d2565b935050608061449f89828a016140d2565b92505060a087013567ffffffffffffffff8111156144c0576144bf61537e565b5b6144cc89828a01614076565b9150509295509295509295565b6144e2816150a2565b82525050565b6144f96144f4826150a2565b61521b565b82525050565b614508816150b4565b82525050565b614517816150c0565b82525050565b61452e614529826150c0565b61522d565b82525050565b600061453f82614f3f565b6145498185614f55565b935061455981856020860161513c565b61456281615388565b840191505092915050565b600061457882614f4a565b6145828185614f71565b935061459281856020860161513c565b61459b81615388565b840191505092915050565b60006145b182614f4a565b6145bb8185614f82565b93506145cb81856020860161513c565b80840191505092915050565b60006145e4601883614f71565b91506145ef826153a6565b602082019050919050565b6000614607601683614f71565b9150614612826153cf565b602082019050919050565b600061462a601f83614f71565b9150614635826153f8565b602082019050919050565b600061464d600d83614f71565b915061465882615421565b602082019050919050565b6000614670601c83614f82565b915061467b8261544a565b601c82019050919050565b6000614693602683614f71565b915061469e82615473565b604082019050919050565b60006146b6601883614f71565b91506146c1826154c2565b602082019050919050565b60006146d9601c83614f71565b91506146e4826154eb565b602082019050919050565b60006146fc601083614f71565b915061470782615514565b602082019050919050565b600061471f602283614f71565b915061472a8261553d565b604082019050919050565b6000614742601683614f71565b915061474d8261558c565b602082019050919050565b6000614765601083614f71565b9150614770826155b5565b602082019050919050565b6000614788600f83614f71565b9150614793826155de565b602082019050919050565b60006147ab602283614f71565b91506147b682615607565b604082019050919050565b60006147ce601483614f71565b91506147d982615656565b602082019050919050565b60006147f1602083614f71565b91506147fc8261567f565b602082019050919050565b6000614814601b83614f71565b915061481f826156a8565b602082019050919050565b6000614837601983614f71565b9150614842826156d1565b602082019050919050565b600061485a600e83614f71565b9150614865826156fa565b602082019050919050565b600061487d601e83614f71565b915061488882615723565b602082019050919050565b60006148a0600083614f66565b91506148ab8261574c565b600082019050919050565b60006148c3602583614f71565b91506148ce8261574f565b604082019050919050565b60006148e6601183614f71565b91506148f18261579e565b602082019050919050565b6000614909601683614f71565b9150614914826157c7565b602082019050919050565b600061492c601683614f71565b9150614937826157f0565b602082019050919050565b600061494f601383614f71565b915061495a82615819565b602082019050919050565b61496e81615116565b82525050565b61498561498082615116565b615249565b82525050565b61499481615120565b82525050565b60006149a682856145a6565b91506149b282846145a6565b91508190509392505050565b60006149c982614663565b91506149d5828461451d565b60208201915081905092915050565b60006149ef82614893565b9150819050919050565b6000614a058288614974565b602082019150614a158287614974565b602082019150614a258286614974565b602082019150614a358285614974565b602082019150614a4582846144e8565b6014820191508190509695505050505050565b6000602082019050614a6d60008301846144d9565b92915050565b6000608082019050614a8860008301876144d9565b614a9560208301866144d9565b614aa26040830185614965565b8181036060830152614ab48184614534565b905095945050505050565b6000602082019050614ad460008301846144ff565b92915050565b6000604082019050614aef600083018561450e565b8181036020830152614b018184614534565b90509392505050565b6000608082019050614b1f600083018761450e565b614b2c602083018661498b565b614b39604083018561450e565b614b46606083018461450e565b95945050505050565b60006020820190508181036000830152614b69818461456d565b905092915050565b60006020820190508181036000830152614b8a816145d7565b9050919050565b60006020820190508181036000830152614baa816145fa565b9050919050565b60006020820190508181036000830152614bca8161461d565b9050919050565b60006020820190508181036000830152614bea81614640565b9050919050565b60006020820190508181036000830152614c0a81614686565b9050919050565b60006020820190508181036000830152614c2a816146a9565b9050919050565b60006020820190508181036000830152614c4a816146cc565b9050919050565b60006020820190508181036000830152614c6a816146ef565b9050919050565b60006020820190508181036000830152614c8a81614712565b9050919050565b60006020820190508181036000830152614caa81614735565b9050919050565b60006020820190508181036000830152614cca81614758565b9050919050565b60006020820190508181036000830152614cea8161477b565b9050919050565b60006020820190508181036000830152614d0a8161479e565b9050919050565b60006020820190508181036000830152614d2a816147c1565b9050919050565b60006020820190508181036000830152614d4a816147e4565b9050919050565b60006020820190508181036000830152614d6a81614807565b9050919050565b60006020820190508181036000830152614d8a8161482a565b9050919050565b60006020820190508181036000830152614daa8161484d565b9050919050565b60006020820190508181036000830152614dca81614870565b9050919050565b60006020820190508181036000830152614dea816148b6565b9050919050565b60006020820190508181036000830152614e0a816148d9565b9050919050565b60006020820190508181036000830152614e2a816148fc565b9050919050565b60006020820190508181036000830152614e4a8161491f565b9050919050565b60006020820190508181036000830152614e6a81614942565b9050919050565b6000602082019050614e866000830184614965565b92915050565b6000614e96614ea7565b9050614ea282826151a1565b919050565b6000604051905090565b600067ffffffffffffffff821115614ecc57614ecb615340565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614ef857614ef7615340565b5b614f0182615388565b9050602081019050919050565b600067ffffffffffffffff821115614f2957614f28615340565b5b614f3282615388565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000614f9882615116565b9150614fa383615116565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614fd857614fd7615284565b5b828201905092915050565b6000614fee82615116565b9150614ff983615116565b925082615009576150086152b3565b5b828204905092915050565b600061501f82615116565b915061502a83615116565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561506357615062615284565b5b828202905092915050565b600061507982615116565b915061508483615116565b92508282101561509757615096615284565b5b828203905092915050565b60006150ad826150f6565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b8381101561515a57808201518184015260208101905061513f565b83811115615169576000848401525b50505050565b6000600282049050600182168061518757607f821691505b6020821081141561519b5761519a6152e2565b5b50919050565b6151aa82615388565b810181811067ffffffffffffffff821117156151c9576151c8615340565b5b80604052505050565b60006151dd82615116565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156152105761520f615284565b5b600182019050919050565b600061522682615237565b9050919050565b6000819050919050565b600061524282615399565b9050919050565b6000819050919050565b600061525e82615116565b915061526983615116565b925082615279576152786152b3565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b7f4854343a205472616e736665722042206661696c656400000000000000000000600082015250565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b7f4854343a206e6f74207768746c00000000000000000000000000000000000000600082015250565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4854343a207072654d696e74517479206f766572206d61780000000000000000600082015250565b7f4854343a207072696f725068206f7665722063726e7420706861736500000000600082015250565b7f4854343a20717479206973207a65726f00000000000000000000000000000000600082015250565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b7f4854343a205472616e736665722041206661696c656400000000000000000000600082015250565b7f4854343a206e6f7420616c6c6f77656400000000000000000000000000000000600082015250565b7f4854343a204e6f74206275726e65720000000000000000000000000000000000600082015250565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b7f4854343a20717479206f76657220737570706c79000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4854343a20616c7265616479206d696e74656420616c6c6f7765640000000000600082015250565b7f4854343a20507562206d696e74206e6f7420616c6c6f77656400000000000000600082015250565b7f4854343a2063616e74206d696e74000000000000000000000000000000000000600082015250565b7f4854343a207072654d696e745068206f7665722063726e742070686173650000600082015250565b50565b7f4854343a207072696f7251747920616e64207072654d696e74517479206f766560008201527f72206d6178000000000000000000000000000000000000000000000000000000602082015250565b7f4854343a2076616c7565206973206c6f77000000000000000000000000000000600082015250565b7f4854343a207072696f72517479206f766572206d617800000000000000000000600082015250565b7f4854343a20717479206f766572206d6178506572547800000000000000000000600082015250565b7f4854343a2043616e6e6f742072656465656d2e00000000000000000000000000600082015250565b61584b816150a2565b811461585657600080fd5b50565b615862816150b4565b811461586d57600080fd5b50565b615879816150ca565b811461588457600080fd5b50565b61589081615116565b811461589b57600080fd5b5056fea26469706673582212200b85c5d4328276c6b39034f7bd8816041ba7162e910d770057d777531aeefbe564736f6c63430008060033

Verified Source Code Partial Match

Compiler: v0.8.6+commit.11564f7e EVM: berlin Optimization: No
ERC721A.sol 612 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import 'erc721a/contracts/IERC721A.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is Context, ERC165, IERC721A {
    using Address for address;
    using Strings for uint256;

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

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

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 30331;
    }

    /**
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        _addressData[owner].aux = aux;
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr) if (curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant:
                    // There will always be an ownership that has an address and is not burned
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _ownershipOf(tokenId).addr;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     *   {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex < end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex < end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            do {
                emit Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex < end);

            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        bool isApprovedOrOwner = (_msgSender() == from ||
            isApprovedForAll(from, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = to;
            currSlot.startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        address from = prevOwnership.addr;

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSender() == from ||
                isApprovedForAll(from, _msgSender()) ||
                getApproved(tokenId) == _msgSender());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            AddressData storage addressData = _addressData[from];
            addressData.balance -= 1;
            addressData.numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = from;
            currSlot.startTimestamp = uint64(block.timestamp);
            currSlot.burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
            return retval == IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}
IERC721A.sol 109 lines
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';

/**
 * @dev Interface of an ERC721A compliant contract.
 */
interface IERC721A is IERC721, IERC721Metadata {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * The caller cannot approve to the current owner.
     */
    error ApprovalToCurrentOwner();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     * 
     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);
}
HuxleyComicsIssue4.sol 337 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";

import "./interfaces/IBurnable.sol";

import "./ERC721A.sol";

/**
 * Huxley Comics Issue 4. It uses ERC721A.
 */
contract HuxleyComicsIssue4 is ERC721A, IBurnable, Ownable {
    using SignatureChecker for address;

    /// @dev Price for one token. Set after deploy.
    uint256 public price;

    /// @dev Uri of metada. Set after deploy. 
    string private uri;

    /// @dev address used to sign priority list addresses
    address public signer;

    /// @dev address that can burn tokens
    address public burner;

    /// @dev Currrent mint phase
    uint256 public currentPhase;

   /// @dev Max amount of tokens that can be minted in one tx
    uint256 public maxMintPerTransaction;

    /// @dev Sets when public mint (without a need to use a signature to mint)
    bool public canPublicMint;

    /// @dev Sets when can phase mint is allowed
    bool public canPhaseMint;

    /// @dev Sets when can redeem copy
    bool public canRedeemCopy;

    /// @dev Address to receive a fee
    address private trustedWallet_A;

    /// @dev Address to receive a fee
    address private trustedWallet_B;

    /// @dev Mapping of redemptions - tokenId -> true/false
    mapping(uint256 => bool) public redemptions;

    /// @dev PRE_MINT value
    uint256 public constant PRE_MINT = 100;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token.
     */
    constructor() ERC721A("HUXLEY Comics: ISSUE 4", "HUXLEY4") {}

    /**
     * @dev It mints in phases. Address to mint should be whitelisted using a signature.
     *      Priority Phase is until 7. After Phase 7, it is Pre Mint Phase.
     *
     * @param _priorityStartingPhase Priority phase - from 1 to 7
     * @param _priorityQtyAllowed Amount allowed to mint during Priority phase
     * @param _preMintStartingPhase Pre Mint phase - it starts from 8
     * @param _preMintQtyAllowed Amount allowed to mint during pre Mint phase
     * @param _quantity Amount to mint.
     * @param _signature Signature that authorizes and address to mint during priority or pre mint phase
     */
    function phaseMint(
        uint256 _priorityStartingPhase,
        uint256 _priorityQtyAllowed,
        uint256 _preMintStartingPhase,
        uint256 _preMintQtyAllowed,
        uint256 _quantity,
        bytes memory _signature
    ) external payable {
        require(canPhaseMint, "HT4: cant mint");
        require(_quantity > 0, "HT4: qty is zero");

        require(
            isWhitelisted(
                _signature,
                _priorityStartingPhase,
                _priorityQtyAllowed,
                _preMintStartingPhase,
                _preMintQtyAllowed
            ),
            "HT4: not whtl"
        );

        uint256 cumulativeMint = _numberMinted(msg.sender) + _quantity;

        if (currentPhase <= 7) {
            // priority phases
            require(_priorityStartingPhase > 0, "HT4: not allowed");
            require(_priorityStartingPhase <= currentPhase, "HT4: priorPh over crnt phase");
            require(cumulativeMint <= _priorityQtyAllowed, "HT4: already minted allowed");
        } else {
            // premint phases
            if (_priorityStartingPhase > 0) {
                // I'm allowed on priority, but priority should be less than 7 (extra check)
                require(_priorityStartingPhase <= 7, "HT4: priorPh over crnt phase");

                // I am allowed to mint during preMint and I am in correct phase?
                // so check if amount of tokens minteds are greater than total
                if (_preMintStartingPhase > 0) {
                    // I can mint all the things
                    if (_preMintStartingPhase <= currentPhase) {
                        require(
                            cumulativeMint <= _priorityQtyAllowed + _preMintQtyAllowed,
                            "HT4: priorQty and preMintQty over max"
                        );
                    } else {
                        require(cumulativeMint <= _priorityQtyAllowed, "HT4: priorQty over max");
                    }
                } else {
                    // _preMintStartingPhase == 0 -> Cannot preMint
                    // I can only mint up to my priority minting allowed
                    require(cumulativeMint <= _priorityQtyAllowed, "HT4: already minted allowed");
                }
            } else {
                // user is not allowed to priorityMint
                require(_preMintStartingPhase > 0, "HT4: not allowed");

                //check if correct phase
                require(_preMintStartingPhase <= currentPhase, "HT4: preMintPh over crnt phase");

                //check amount minted
                require(cumulativeMint <= _preMintQtyAllowed, "HT4: preMintQty over max");
            }
        }

        mint(_quantity);
    }

    /**
     * @dev It is a public mint. It isn't necessary to be whitelisted or use a signature.
     * @param _quantity Amount to mint. It should be less than max mint per tx
     */
    function publicMint(uint256 _quantity) external payable {
        require(canPublicMint, "HT4: Pub mint not allowed");
        mint(_quantity);
    }

    /**
     * @dev Mints a certain amount of Tokens.
     * @param _quantity Amount to mint. It should be less than max mint per tx.
     */
    function mint(uint256 _quantity) internal {
        require(_quantity <= maxMintPerTransaction, "HT4: qty over maxPerTx");
        require(hasFirstEditionSupplyLeft(_quantity), "HT4: qty over supply");

        uint256 totalPaid = price * _quantity;
        require(msg.value >= totalPaid, "HT4: value is low");

        payment();

        _safeMint(msg.sender, _quantity);
    }

    /**
     * @dev Private mint. OnlyOwner can call this function.
     * @param _amountToMint Amount to mint.
     * @param _recipient Address to receive token.
     */
    function privateMint(uint256 _amountToMint, address _recipient) external onlyOwner() {
        _safeMint(_recipient, _amountToMint);
    }

    /**
     * @dev Reserved for future utility.
     * @param _tokenIds List of tokens ids to burn.
     */
    function burnBatch(uint256[] memory _tokenIds) public virtual override {
        require(msg.sender == burner, "HT4: Not burner");
        unchecked {
            for (uint256 i = 0; i < _tokenIds.length; i++) {
                uint256 _tokenId = _tokenIds[i];
                _burn(_tokenId, false);
            }
        }
    }

    /// @dev User can redeem a copy
    function redeemCopy(uint256[] memory _tokenIds) external {
        require(canRedeemCopy, "HT4: Cannot redeem.");
        unchecked {
            for (uint256 i = 0; i < _tokenIds.length; i++) {
                uint256 _tokenId = _tokenIds[i];
                if (ownerOf(_tokenId) == msg.sender) {
                    redemptions[_tokenId] = true;
                }
            }
        }
    }

    /**
     * @dev Check if an address is whitelisted. 
     * @param _signature Signature to check.
     * @param _priorityStartingPhase Priority start phase
     * @param _priorityQtyAllowed Quantity allowed to mint during priority phase
     * @param _preMintStartingPhase Pre mint start phase
     * @param _preMintQtyAllowed Quantity allowed to mint during pre mint
     */
    function isWhitelisted(
        bytes memory _signature,
        uint256 _priorityStartingPhase,
        uint256 _priorityQtyAllowed,
        uint256 _preMintStartingPhase,
        uint256 _preMintQtyAllowed
    ) internal view returns (bool) {
        bytes32 result =
            keccak256(
                abi.encodePacked(
                    _priorityStartingPhase,
                    _priorityQtyAllowed,
                    _preMintStartingPhase,
                    _preMintQtyAllowed,
                    msg.sender
                )
            );
        bytes32 hash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", result));
        return signer.isValidSignatureNow(hash, _signature);
    }

    /**
     * @dev Returns if it has supply lefted. It is calculated using amount of tokens minted + amount to mint
     * @param _quantity Amount to mint 
     */
    function hasFirstEditionSupplyLeft(uint256 _quantity) internal view returns (bool) {
        uint256 totalFirstEditionMinted = totalSupply() - PRE_MINT + _quantity;
        return totalFirstEditionMinted <= 10000;
    }

    /// @dev Split value paid for a token
    function payment() internal {
        unchecked {
            uint256 amount = (msg.value * 85) / 100;
            (bool success, ) = trustedWallet_A.call{value: amount}("");
            require(success, "HT4: Transfer A failed");

            amount = msg.value - amount;
            (success, ) = trustedWallet_B.call{value: amount}("");
            require(success, "HT4: Transfer B failed");
        }
    }

    /// @dev Sets a mint phase. OnlyOwner can call it.
    function setPhase(uint256 _phase) external onlyOwner {
        currentPhase = _phase;
    }

    /// @dev Set base uri. OnlyOwner can call it.
    function setBaseURI(string memory _value) external onlyOwner {
        uri = _value;
    }

    /// @dev Returns base uri
    function _baseURI() internal view virtual override returns (string memory) {
        return uri;
    }

    /**
     * @dev Updates address of 'signer'
     * @param _signer  New address for 'signer'
     */
    function setSigner(address _signer) external onlyOwner {
        signer = _signer;
    }

    /**
     * @dev Updates address of 'burner'
     * @param _burner  New address for 'burner'
     */
    function setBurner(address _burner) external onlyOwner {
        burner = _burner;
    }

    /**
     * @dev Updates address of 'trustedWallet_A'
     * @param _trustedWallet  New address for 'trustedWallet_A'
     */
    function setTrustedWallet_A(address _trustedWallet) external onlyOwner {
        trustedWallet_A = _trustedWallet;
    }

    /**
     * @dev Updates address of 'trustedWallet_B'
     * @param _trustedWallet  New address for 'trustedWallet_B'
     */
    function setTrustedWallet_B(address _trustedWallet) external onlyOwner {
        trustedWallet_B = _trustedWallet;
    }

    /**
     * @dev Updates value of 'price'
     * @param _price  New value of 'price'
     */
    function setPrice(uint256 _price) external onlyOwner {
        price = _price;
    }

    /**
     * @dev Updates value of 'canRedeemCopy'
     * @param _value  New value of 'canRedeemCopy'
     */
    function setCanRedeemCopy(bool _value) external onlyOwner {
        canRedeemCopy = _value;
    }

    /**
     * @dev Updates value of 'maxMintPerTransaction'
     * @param _value  New value of 'maxMintPerTransaction'
     */
    function setMaxMintPerTransaction(uint256 _value) external onlyOwner {
        maxMintPerTransaction = _value;
    }

    /**
     * @dev Updates value of 'canPhaseMint'
     * @param _value  New value of 'canPhaseMint'
     */
    function setCanPhaseMint(bool _value) external onlyOwner {
        canPhaseMint = _value;
    }

    /**
     * @dev Updates value of 'canPublicMint'
     * @param _value  New value of 'canPublicMint'
     */
    function setCanPublicMint(bool _value) external onlyOwner {
        canPublicMint = _value;
    }
}
IBurnable.sol 18 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "erc721a/contracts/IERC721A.sol";

/**
 * @dev Interface of an ERC721ABurnable compliant contract.
 */
interface IBurnable is IERC721A {
    /**
     * @dev Burns `tokenId`. See {ERC721A-_burn}.
     *
     * Requirements:
     *
     * - The caller must own `tokenId` or be an approved operator.
     */
    function burnBatch(uint256[] memory _tokenIds) external;
}
Address.sol 210 lines
// SPDX-License-Identifier: MIT

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);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private 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);
            }
        }
    }
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
Strings.sol 66 lines
// SPDX-License-Identifier: MIT

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);
    }
}
Ownable.sol 71 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
IERC1271.sol 18 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}
IERC721.sol 142 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}
ECDSA.sol 139 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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 {
    /**
     * @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.
     *
     * 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]
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // 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 recover(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 recover(hash, r, vs);
        } else {
            revert("ECDSA: invalid signature length");
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} 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.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return recover(hash, v, r, s);
    }

    /**
     * @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) {
        // 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 (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): 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.
        require(
            uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,
            "ECDSA: invalid signature 's' value"
        );
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @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 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));
    }
}
ERC165.sol 28 lines
// SPDX-License-Identifier: MIT

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;
    }
}
IERC165.sol 24 lines
// SPDX-License-Identifier: MIT

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);
}
IERC721Receiver.sol 26 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
SignatureChecker.sol 35 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../Address.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper: Provide a single mechanism to verify both private-key (EOA) ECDSA signature and
 * ERC1271 contract sigantures. Using this instead of ECDSA.recover in your contract will make them compatible with
 * smart contract wallets such as Argent and Gnosis.
 *
 * Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change
 * through time. It could return true at block N and false at block N+1 (or the opposite).
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    function isValidSignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        if (Address.isContract(signer)) {
            try IERC1271(signer).isValidSignature(hash, signature) returns (bytes4 magicValue) {
                return magicValue == IERC1271(signer).isValidSignature.selector;
            } catch {
                return false;
            }
        } else {
            return ECDSA.recover(hash, signature) == signer;
        }
    }
}
IERC721Metadata.sol 26 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

Read Contract

PRE_MINT 0x432d2e4c → uint256
balanceOf 0x70a08231 → uint256
burner 0x27810b6e → address
canPhaseMint 0x44c6b6ed → bool
canPublicMint 0x413185f2 → bool
canRedeemCopy 0x0188a09d → bool
currentPhase 0x055ad42e → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxMintPerTransaction 0x01f56997 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
price 0xa035b1fe → uint256
redemptions 0xbeb65893 → bool
signer 0x238ac933 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256

Write Contract 23 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
burnBatch 0xe4623c1b
uint256[] _tokenIds
phaseMint 0xef519cfd
uint256 _priorityStartingPhase
uint256 _priorityQtyAllowed
uint256 _preMintStartingPhase
uint256 _preMintQtyAllowed
uint256 _quantity
bytes _signature
privateMint 0xbef870ca
uint256 _amountToMint
address _recipient
publicMint 0x2db11544
uint256 _quantity
redeemCopy 0x4866b7b0
uint256[] _tokenIds
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _value
setBurner 0xa996d6ce
address _burner
setCanPhaseMint 0x200ce872
bool _value
setCanPublicMint 0x3e28350b
bool _value
setCanRedeemCopy 0xaa5e23c0
bool _value
setMaxMintPerTransaction 0x2e6cebe5
uint256 _value
setPhase 0x2cc82655
uint256 _phase
setPrice 0x91b7f5ed
uint256 _price
setSigner 0x6c19e783
address _signer
setTrustedWallet_A 0x033b8e2d
address _trustedWallet
setTrustedWallet_B 0xf33063e5
address _trustedWallet
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

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