Address Contract Partially Verified
Address
0xD69d1c99371B170220c2A2d1ea32241541C1fF41
Balance
0 ETH
Nonce
1
Code Size
13327 bytes
Creator
0x0F98FD01...A23E at tx 0x5931f53d...69006f
Indexed Transactions
0
Contract Bytecode
13327 bytes
0x60806040526004361061031d5760003560e01c806370a08231116101a5578063ad6cb319116100ec578063d88cc3ff11610095578063ee32b4111161006f578063ee32b41114610873578063f0ce79f314610888578063f2fde38b146108a7578063f43a22dc146108c757600080fd5b8063d88cc3ff146107e8578063e8a3d48514610815578063e985e9c51461082a57600080fd5b8063c0f67b0a116100c6578063c0f67b0a14610798578063c87b56dd146107ae578063cd902acf146107ce57600080fd5b8063ad6cb31914610742578063b88d4fde14610758578063bf509b9d1461077857600080fd5b80638da5cb5b1161014e57806395d89b411161012857806395d89b41146106ed578063a22cb46514610702578063a58fdc111461072257600080fd5b80638da5cb5b1461069a578063938e3d7b146106b857806395a61357146106d857600080fd5b806383af79e71161017f57806383af79e71461064457806385d6bb81146106645780638a71bb2d1461068457600080fd5b806370a08231146105f9578063715018a6146106195780637ff9b5961461062e57600080fd5b80632db115441161026957806355f804b3116102125780636a61e5fc116101ec5780636a61e5fc146105af5780636ae146c2146105cf5780636c0360eb146105e457600080fd5b806355f804b31461054f57806361ba27da1461056f5780636352211e1461058f57600080fd5b80634047638d116102435780634047638d1461050757806342842e0e1461051c5780634614467d1461053c57600080fd5b80632db11544146104c957806332cb6b0c146104dc5780633ccfd60b146104f257600080fd5b806318160ddd116102cb57806323b872dd116102a557806323b872dd146104575780632a55205a146104775780632b314dc6146104b657600080fd5b806318160ddd1461040c5780631b8926a91461042157806322766e9d1461043757600080fd5b8063081812fc116102fc578063081812fc14610390578063095ea7b3146103c857806315f5d8a0146103e857600080fd5b806269496e1461032257806301ffc9a71461033957806306fdde031461036e575b600080fd5b34801561032e57600080fd5b506103376108dc565b005b34801561034557600080fd5b50610359610354366004612c5e565b610975565b60405190151581526020015b60405180910390f35b34801561037a57600080fd5b506103836109d1565b6040516103659190612cd3565b34801561039c57600080fd5b506103b06103ab366004612ce6565b610a63565b6040516001600160a01b039091168152602001610365565b3480156103d457600080fd5b506103376103e3366004612d1b565b610b09565b3480156103f457600080fd5b506103fe600a5481565b604051908152602001610365565b34801561041857600080fd5b506103fe610c3a565b34801561042d57600080fd5b506103fe60095481565b34801561044357600080fd5b50610337610452366004612ce6565b610c50565b34801561046357600080fd5b50610337610472366004612d45565b610caf565b34801561048357600080fd5b50610497610492366004612d81565b610d36565b604080516001600160a01b039093168352602083019190915201610365565b6103376104c4366004612da3565b610dd6565b6103376104d7366004612ce6565b6110a6565b3480156104e857600080fd5b506103fe61271081565b3480156104fe57600080fd5b5061033761126c565b34801561051357600080fd5b5061033761138b565b34801561052857600080fd5b50610337610537366004612d45565b611417565b61033761054a366004612e82565b611432565b34801561055b57600080fd5b5061033761056a366004612f8c565b6116b0565b34801561057b57600080fd5b5061033761058a366004612ce6565b61171a565b34801561059b57600080fd5b506103b06105aa366004612ce6565b611779565b3480156105bb57600080fd5b506103376105ca366004612ce6565b611804565b3480156105db57600080fd5b50610337611863565b3480156105f057600080fd5b5061038361192b565b34801561060557600080fd5b506103fe610614366004612fd5565b6119b9565b34801561062557600080fd5b50610337611a53565b34801561063a57600080fd5b506103fe600b5481565b34801561065057600080fd5b5061033761065f366004612ce6565b611ab7565b34801561067057600080fd5b5061033761067f366004612fd5565b611b16565b34801561069057600080fd5b506103fe600c5481565b3480156106a657600080fd5b506006546001600160a01b03166103b0565b3480156106c457600080fd5b506103376106d3366004612f8c565b611baa565b3480156106e457600080fd5b506103fe600281565b3480156106f957600080fd5b50610383611c10565b34801561070e57600080fd5b5061033761071d366004612ff0565b611c1f565b34801561072e57600080fd5b5061033761073d366004612ce6565b611c2a565b34801561074e57600080fd5b506103fe60105481565b34801561076457600080fd5b5061033761077336600461302c565b611c89565b34801561078457600080fd5b50610337610793366004612ce6565b611d17565b3480156107a457600080fd5b506103fe600f5481565b3480156107ba57600080fd5b506103836107c9366004612ce6565b611d76565b3480156107da57600080fd5b50600d546103599060ff1681565b3480156107f457600080fd5b506103fe610803366004612fd5565b60116020526000908152604090205481565b34801561082157600080fd5b50610383611e5f565b34801561083657600080fd5b506103596108453660046130a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561087f57600080fd5b506103fe600381565b34801561089457600080fd5b50600d5461035990610100900460ff1681565b3480156108b357600080fd5b506103376108c2366004612fd5565b611e6e565b3480156108d357600080fd5b506103fe600181565b6006546001600160a01b0316331461093b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600d80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff81166101009182900460ff1615909102179055565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a0000000000000000000000000000000000000000000000000000000014806109cb57506109cb82611f50565b92915050565b6060600080546109e0906130db565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0c906130db565b8015610a595780601f10610a2e57610100808354040283529160200191610a59565b820191906000526020600020905b815481529060010190602001808311610a3c57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610aed5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610932565b506000908152600460205260409020546001600160a01b031690565b6000610b1482611779565b9050806001600160a01b0316836001600160a01b031603610b9d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610932565b336001600160a01b0382161480610bb95750610bb98133610845565b610c2b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610932565b610c358383612033565b505050565b60006001600e54610c4b919061315d565b905090565b6006546001600160a01b03163314610caa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600f55565b610cb933826120b9565b610d2b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610932565b610c358383836121c1565b60008281526002602052604081205481906001600160a01b0316610d9c5760405162461bcd60e51b815260206004820152601260248201527f4e6f6e2d6578697374656e7420746f6b656e00000000000000000000000000006044820152606401610932565b600a600c54610dab91906131a3565b610db66064856131a3565b610dc091906131b7565b6008546001600160a01b03169590945092505050565b8261271081610de3610c3a565b610ded91906131d6565b1115610e3b5760405162461bcd60e51b815260206004820152601260248201527f45786365656473206d617820737570706c7900000000000000000000000000006044820152606401610932565b600a548490610e4a82826131b7565b3414610e985760405162461bcd60e51b815260206004820152601460248201527f496e636f72726563742065746865722073656e740000000000000000000000006044820152606401610932565b333214610ee75760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e74726163747300000000000000000000000000000000000000006044820152606401610932565b600d54610100900460ff16610f3e5760405162461bcd60e51b815260206004820181905260248201527f6d696e74696e6720697320636c6f73656420666f7220616c6c6f77206c6973746044820152606401610932565b33600090815260116020526040902054600390610f5c9088906131d6565b1115610faa5760405162461bcd60e51b815260206004820152601760248201527f4578636565647320414c2077616c6c6574206c696d69740000000000000000006044820152606401610932565b611033858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506010546040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b16602082015290925060340190505b604051602081830303815290604052805190602001206123a6565b61107f5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206d65726b6c652070726f6f660000000000000000000000006044820152606401610932565b33600081815260116020526040902080548801905561109e90876123bc565b505050505050565b80612710816110b3610c3a565b6110bd91906131d6565b111561110b5760405162461bcd60e51b815260206004820152601260248201527f45786365656473206d617820737570706c7900000000000000000000000000006044820152606401610932565b81600181111561115d5760405162461bcd60e51b815260206004820152601260248201527f45786365656473206d61782070657220747800000000000000000000000000006044820152606401610932565b600b54839061116c82826131b7565b34146111ba5760405162461bcd60e51b815260206004820152601460248201527f496e636f72726563742065746865722073656e740000000000000000000000006044820152606401610932565b3332146112095760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e74726163747300000000000000000000000000000000000000006044820152606401610932565b600d5460ff1661125b5760405162461bcd60e51b815260206004820152601160248201527f6d696e74696e6720697320636c6f7365640000000000000000000000000000006044820152606401610932565b61126533866123bc565b5050505050565b6002600754036112be5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610932565b600260075560085447906112df9082906001600160a01b0316612710612446565b6008546040516000916001600160a01b03169047908381818185875af1925050503d806000811461132c576040519150601f19603f3d011682016040523d82523d6000602084013e611331565b606091505b50509050806113825760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610932565b50506001600755565b6006546001600160a01b031633146113e55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600d80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00811660ff90911615179055565b610c3583838360405180602001604052806000815250611c89565b816127108161143f610c3a565b61144991906131d6565b11156114975760405162461bcd60e51b815260206004820152601260248201527f45786365656473206d617820737570706c7900000000000000000000000000006044820152606401610932565b60095483906114a682826131b7565b34146114f45760405162461bcd60e51b815260206004820152601460248201527f496e636f72726563742065746865722073656e740000000000000000000000006044820152606401610932565b3332146115435760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e74726163747300000000000000000000000000000000000000006044820152606401610932565b600d54610100900460ff1661159a5760405162461bcd60e51b815260206004820152601f60248201527f6d696e74696e6720697320636c6f73656420666f7220616c6c6f776c697374006044820152606401610932565b336000908152601160205260409020546002906115b89087906131d6565b11156116065760405162461bcd60e51b815260206004820152601760248201527f4578636565647320414c2077616c6c6574206c696d69740000000000000000006044820152606401610932565b600f546040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152611645918691603401611018565b6116915760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206d65726b6c652070726f6f660000000000000000000000006044820152606401610932565b33600081815260116020526040902080548701905561126590866123bc565b6006546001600160a01b0316331461170a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b60136117168282613234565b5050565b6006546001600160a01b031633146117745760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600c55565b6000818152600260205260408120546001600160a01b0316806109cb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610932565b6006546001600160a01b0316331461185e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600b55565b6006546001600160a01b031633146118bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b6118c5610c3a565b156119125760405162461bcd60e51b815260206004820152601660248201527f546f6b656e7320616c726561647920636c61696d6564000000000000000000006044820152606401610932565b600854611929906001600160a01b0316601e6123bc565b565b60138054611938906130db565b80601f0160208091040260200160405190810160405280929190818152602001828054611964906130db565b80156119b15780601f10611986576101008083540402835291602001916119b1565b820191906000526020600020905b81548152906001019060200180831161199457829003601f168201915b505050505081565b60006001600160a01b038216611a375760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610932565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b03163314611aad5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b61192960006124fb565b6006546001600160a01b03163314611b115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600a55565b6006546001600160a01b03163314611b705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6006546001600160a01b03163314611c045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b60126117168282613234565b6060600180546109e0906130db565b611716338383612565565b6006546001600160a01b03163314611c845760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b601055565b611c9333836120b9565b611d055760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610932565b611d1184848484612651565b50505050565b6006546001600160a01b03163314611d715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600955565b6000818152600260205260409020546060906001600160a01b0316611e035760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610932565b6000611e0d6126da565b90506000815111611e2d5760405180602001604052806000815250611e58565b80611e37846126e9565b604051602001611e489291906132f4565b6040516020818303038152906040525b9392505050565b6060601280546109e0906130db565b6006546001600160a01b03163314611ec85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b6001600160a01b038116611f445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610932565b611f4d816124fb565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480611fe357507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109cb57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146109cb565b600081815260046020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038416908117909155819061208082611779565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166121435760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610932565b600061214e83611779565b9050806001600160a01b0316846001600160a01b0316148061219557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806121b95750836001600160a01b03166121ae84610a63565b6001600160a01b0316145b949350505050565b826001600160a01b03166121d482611779565b6001600160a01b0316146122505760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610932565b6001600160a01b0382166122cb5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610932565b6122d6600082612033565b6001600160a01b03831660009081526003602052604081208054600192906122ff90849061315d565b90915550506001600160a01b038216600090815260036020526040812080546001929061232d9084906131d6565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000826123b3858461281e565b14949350505050565b60005b81811015610c3557600e80546123e69185919060006123dd83613323565b91905055612892565b806001019050826001600160a01b0316336001600160a01b03167f3eeec77ac6cd89e11a0219346395078d5cd31346758dc9509a5032d822e05cab6001600e54612430919061315d565b60405190815260200160405180910390a36123bf565b60006001600160a01b0383168261245f612710876131a3565b61246991906131b7565b604051600081818185875af1925050503d80600081146124a5576040519150601f19603f3d011682016040523d82523d6000602084013e6124aa565b606091505b5050905080611d115760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610932565b600680546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036125c65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610932565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61265c8484846121c1565b612668848484846128ac565b611d115760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610932565b6060601380546109e0906130db565b60608160000361272c57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612756578061274081613323565b915061274f9050600a836131a3565b9150612730565b60008167ffffffffffffffff81111561277157612771612e22565b6040519080825280601f01601f19166020018201604052801561279b576020820181803683370190505b5090505b84156121b9576127b060018361315d565b91506127bd600a8661333d565b6127c89060306131d6565b60f81b8183815181106127dd576127dd613351565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612817600a866131a3565b945061279f565b600081815b845181101561288a57600085828151811061284057612840613351565b602002602001015190508083116128665760008381526020829052604090209250612877565b600081815260208490526040902092505b508061288281613323565b915050612823565b509392505050565b611716828260405180602001604052806000815250612a4d565b60006001600160a01b0384163b15612a42576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a0290612909903390899088908890600401613380565b6020604051808303816000875af1925050508015612944575060408051601f3d908101601f19168201909252612941918101906133bc565b60015b6129f7573d808015612972576040519150601f19603f3d011682016040523d82523d6000602084013e612977565b606091505b5080516000036129ef5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610932565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490506121b9565b506001949350505050565b612a578383612ad6565b612a6460008484846128ac565b610c355760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610932565b6001600160a01b038216612b2c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610932565b6000818152600260205260409020546001600160a01b031615612b915760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610932565b6001600160a01b0382166000908152600360205260408120805460019290612bba9084906131d6565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611f4d57600080fd5b600060208284031215612c7057600080fd5b8135611e5881612c30565b60005b83811015612c96578181015183820152602001612c7e565b83811115611d115750506000910152565b60008151808452612cbf816020860160208601612c7b565b601f01601f19169290920160200192915050565b602081526000611e586020830184612ca7565b600060208284031215612cf857600080fd5b5035919050565b80356001600160a01b0381168114612d1657600080fd5b919050565b60008060408385031215612d2e57600080fd5b612d3783612cff565b946020939093013593505050565b600080600060608486031215612d5a57600080fd5b612d6384612cff565b9250612d7160208501612cff565b9150604084013590509250925092565b60008060408385031215612d9457600080fd5b50508035926020909101359150565b600080600060408486031215612db857600080fd5b83359250602084013567ffffffffffffffff80821115612dd757600080fd5b818601915086601f830112612deb57600080fd5b813581811115612dfa57600080fd5b8760208260051b8501011115612e0f57600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612e7a57612e7a612e22565b604052919050565b60008060408385031215612e9557600080fd5b8235915060208084013567ffffffffffffffff80821115612eb557600080fd5b818601915086601f830112612ec957600080fd5b813581811115612edb57612edb612e22565b8060051b9150612eec848301612e51565b8181529183018401918481019089841115612f0657600080fd5b938501935b83851015612f2457843582529385019390850190612f0b565b8096505050505050509250929050565b600067ffffffffffffffff831115612f4e57612f4e612e22565b612f616020601f19601f86011601612e51565b9050828152838383011115612f7557600080fd5b828260208301376000602084830101529392505050565b600060208284031215612f9e57600080fd5b813567ffffffffffffffff811115612fb557600080fd5b8201601f81018413612fc657600080fd5b6121b984823560208401612f34565b600060208284031215612fe757600080fd5b611e5882612cff565b6000806040838503121561300357600080fd5b61300c83612cff565b91506020830135801515811461302157600080fd5b809150509250929050565b6000806000806080858703121561304257600080fd5b61304b85612cff565b935061305960208601612cff565b925060408501359150606085013567ffffffffffffffff81111561307c57600080fd5b8501601f8101871361308d57600080fd5b61309c87823560208401612f34565b91505092959194509250565b600080604083850312156130bb57600080fd5b6130c483612cff565b91506130d260208401612cff565b90509250929050565b600181811c908216806130ef57607f821691505b602082108103613128577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561316f5761316f61312e565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826131b2576131b2613174565b500490565b60008160001904831182151516156131d1576131d161312e565b500290565b600082198211156131e9576131e961312e565b500190565b601f821115610c3557600081815260208120601f850160051c810160208610156132155750805b601f850160051c820191505b8181101561109e57828155600101613221565b815167ffffffffffffffff81111561324e5761324e612e22565b6132628161325c84546130db565b846131ee565b602080601f831160018114613297576000841561327f5750858301515b600019600386901b1c1916600185901b17855561109e565b600085815260208120601f198616915b828110156132c6578886015182559484019460019091019084016132a7565b50858210156132e45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351613306818460208801612c7b565b83519083019061331a818360208801612c7b565b01949350505050565b600060001982036133365761333661312e565b5060010190565b60008261334c5761334c613174565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006001600160a01b038087168352808616602084015250836040830152608060608301526133b26080830184612ca7565b9695505050505050565b6000602082840312156133ce57600080fd5b8151611e5881612c3056fea264697066735822122081165bbad3dba19c934d3ef31aa49508ae31228fd9e88164e59ffb309433f3e164736f6c634300080f0033
Verified Source Code Partial Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: Yes (5000 runs)
EarlyOnesGenesisMembership.sol 418 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
// @title EARLY ONES | Genesis Membership Pass
// @author @David_LoDico
import "../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "../node_modules/@openzeppelin/contracts/interfaces/IERC2981.sol";
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
import "../node_modules/@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "../node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract EarlyOnesGenesisMembership is
ERC721,
IERC2981,
Ownable,
ReentrancyGuard
{
event TransferSingle(
address indexed from,
address indexed to,
uint256 tokenId
);
// Project Wallet
address private _w1;
// Collection values
uint256 public constant MAX_SUPPLY = 10000;
uint256 public constant MAX_PER_TX = 1;
uint256 public constant MAX_PER_AL_WALLET = 2; // AllowList
uint256 public constant MAX_PER_OG_WALLET = 3; // OGList
uint256 public alPrice = 0.04 ether;
uint256 public ogPrice = 0.03 ether;
uint256 public tokenPrice = 0.04269 ether;
uint256 public royaltyPercentage = 75; // 7.5%
// Mint phase toggles
bool public PublicMintActive = false;
bool public ListMintActive = false;
// Track token count
uint256 private _nextTokenId = 1;
// Merkle
bytes32 public merkleRootAL; // MerkleRoot for AllowList
bytes32 public merkleRootOG; // MerkleRoot for OGList
// Track how many tokens addresses have minted
mapping(address => uint256) public mintBalance;
// Metadata URIs
string private _contractURI;
string public baseURI;
/**
* @notice Modifier to check if there is enough supply for the attempted amount to mint
* @param _numberOfTokens The number of tokens attempting to be minted
*/
modifier whenSupplyAvailable(uint256 _numberOfTokens) {
require(
totalSupply() + _numberOfTokens <= MAX_SUPPLY,
"Exceeds max supply"
);
_;
}
/**
* @notice Check functions for correct token amount per tx
* @param _numberOfTokens The number of tokens attempting to be minted
*/
modifier whenUnderMaxPerTx(uint256 _numberOfTokens) {
require(_numberOfTokens <= MAX_PER_TX, "Exceeds max per tx");
_;
}
/**
* @notice Check functions for correct amount of ETH being sent, not more not less
* @param _numberOfTokens The number of tokens to calculate the value required from
*/
modifier whenCorrectEtherSent(uint256 _numberOfTokens, uint256 _price) {
require(msg.value == _price * _numberOfTokens, "Incorrect ether sent");
_;
}
/**
* @notice We want a valuable community of real members. Only humans are allowed to execute these functions
*/
modifier whenHuman() {
require(msg.sender == tx.origin, "No contracts");
_;
}
/**
* @notice Constructor
* @dev Pass in Project wallet addresses
* @dev Pass in the starting contractURI for collection level metadata
* @dev Pass in the starting baseURI for token placeholder metadata
*/
constructor(
address w1,
string memory _startingContractURI,
string memory _startingBaseURI
) ERC721("EARLY ONES | Genesis Membership", "EARLY") {
_w1 = w1;
_contractURI = _startingContractURI;
baseURI = _startingBaseURI;
}
/**
* @notice Get total supply
* @return uint256 Number of tokens minted
*/
function totalSupply() public view returns (uint256) {
return _nextTokenId - 1;
}
/**
* @notice Get contractURI
* @return contractURI The URI for the collection metadata
*/
function contractURI() public view returns (string memory) {
return _contractURI;
}
/**
* @notice Get baseURI
* @dev Overrides {ERC721-_baseURI}
* @return baseURI The base token URI for the collection
*/
function _baseURI() internal view override returns (string memory) {
return baseURI;
}
/**
* @notice Base token minting function
* @dev Cant overflow, so no check needed
* @param _to The address to mint tokens to
* @param _numberOfTokens The number of tokens to be minted
*/
function _internalMint(address _to, uint256 _numberOfTokens) private {
for (uint256 i = 0; i < _numberOfTokens; ) {
_safeMint(_to, _nextTokenId++);
unchecked {
++i;
}
emit TransferSingle(msg.sender, _to, _nextTokenId - 1);
}
}
/**
* @notice Allowlist minting function
* @dev Check that the allowlist mint is active
* @dev Check that an address is not trying to mint more than its max. allocation
* @dev Check that a valid merkle proof is sent with the transaction
* @dev Mint balance incrementation can go unchecked to save gas because we can't overflow
* @param _numberOfTokens The number of tokens to be minted
* @param _merkleProof The proof of allowlist presence required to mint
*/
function alMint(uint256 _numberOfTokens, bytes32[] memory _merkleProof)
external
payable
whenSupplyAvailable(_numberOfTokens)
whenCorrectEtherSent(_numberOfTokens, alPrice)
whenHuman
{
require(ListMintActive, "minting is closed for allowlist");
require(
mintBalance[msg.sender] + _numberOfTokens <= MAX_PER_AL_WALLET,
"Exceeds AL wallet limit"
);
require(
MerkleProof.verify(
_merkleProof,
merkleRootAL,
keccak256(abi.encodePacked(msg.sender))
),
"Invalid merkle proof"
);
unchecked {
mintBalance[msg.sender] += _numberOfTokens;
}
_internalMint(msg.sender, _numberOfTokens);
}
/**
* @notice Allowlist minting function
* @dev Check that the allowlist mint is active
* @dev Check that an address is not trying to mint more than its max. allocation
* @dev Check that a valid merkle proof is sent with the transaction
* @dev Mint balance incrementation can go unchecked to save gas because we can't overflow
* @param _numberOfTokens The number of tokens to be minted
* @param _merkleProof The proof of allowlist presence required to mint
*/
function ogMint(uint256 _numberOfTokens, bytes32[] calldata _merkleProof)
external
payable
whenSupplyAvailable(_numberOfTokens)
whenCorrectEtherSent(_numberOfTokens, ogPrice)
whenHuman
{
require(ListMintActive, "minting is closed for allow list");
require(
mintBalance[msg.sender] + _numberOfTokens <= MAX_PER_OG_WALLET,
"Exceeds AL wallet limit"
);
require(
MerkleProof.verify(
_merkleProof,
merkleRootOG,
keccak256(abi.encodePacked(msg.sender))
),
"Invalid merkle proof"
);
unchecked {
mintBalance[msg.sender] += _numberOfTokens;
}
_internalMint(msg.sender, _numberOfTokens);
}
/**
* @notice Public minting function
* @dev Check that the public mint is active
* @param _numberOfTokens The number of tokens to be minted
*/
function publicMint(uint256 _numberOfTokens)
external
payable
whenSupplyAvailable(_numberOfTokens)
whenUnderMaxPerTx(_numberOfTokens)
whenCorrectEtherSent(_numberOfTokens, tokenPrice)
whenHuman
{
require(PublicMintActive, "minting is closed");
_internalMint(msg.sender, _numberOfTokens);
}
/**
* @notice NFT's for the project
* @dev Can only be used once before any tokens are minted
* @dev Tokens will be used for PFPs, marketing and giveaways
*/
function teamClaim() external onlyOwner {
require(totalSupply() == 0, "Tokens already claimed");
_internalMint(_w1, 30); // Community wallet
}
/**
* @notice Update the community wallet address
* @param _newCommunityWallet The new community wallet address
*/
function setCommunityWallet(address _newCommunityWallet)
external
onlyOwner
{
_w1 = _newCommunityWallet;
}
/**
* @notice Update the price of a single token
* @param _newTokenPrice The new price of a single token
*/
function setAlPrice(uint256 _newTokenPrice) external onlyOwner {
alPrice = _newTokenPrice;
}
/**
* @notice Update the price of a single token
* @param _newTokenPrice The new price of a single token
*/
function setOgPrice(uint256 _newTokenPrice) external onlyOwner {
ogPrice = _newTokenPrice;
}
/**
* @notice Update the price of a single token
* @param _newTokenPrice The new price of a single token
*/
function setTokenPrice(uint256 _newTokenPrice) external onlyOwner {
tokenPrice = _newTokenPrice;
}
/**
* @notice Update royalty percentage for secondary sales
* @param _royaltyPercentage The new royalty percentage
*/
function setRoyaltyPercentage(uint256 _royaltyPercentage)
external
onlyOwner
{
royaltyPercentage = _royaltyPercentage;
}
/**
* @notice Toggle public mint phase
*/
function togglePublicMint() external onlyOwner {
PublicMintActive = !PublicMintActive;
}
/**
* @notice Toggle allow list mint phase
*/
function toggleListMint() external onlyOwner {
ListMintActive = !ListMintActive;
}
/**
* @notice Update the merkle root used for allowlist management
* @dev Root string passed must be proceeded by '0x'
* @param _newMerkleRoot The new root of the merkle tree
*/
function setMerkleRootAL(bytes32 _newMerkleRoot) external onlyOwner {
merkleRootAL = _newMerkleRoot;
}
/**
* @notice Update the merkle root used for allowlist management
* @dev Root string passed must be proceeded by '0x'
* @param _newMerkleRoot The new root of the merkle tree
*/
function setMerkleRootOG(bytes32 _newMerkleRoot) external onlyOwner {
merkleRootOG = _newMerkleRoot;
}
/**
* @notice Update the contractURI
* @dev This is the collection level metadata URL
* @param _newContractURI The new contractURI for the collection
*/
function setContractURI(string memory _newContractURI) external onlyOwner {
_contractURI = _newContractURI;
}
/**
* @notice Update the baseURI
* @dev Must include trailing slash
* @param _newBaseURI The new baseURI for the collection
*/
function setBaseURI(string memory _newBaseURI) external onlyOwner {
baseURI = _newBaseURI;
}
/**
* @notice Internal withdraw function
* @param _balance The balance to be split
* @param _address The address to send the balance to
* @param _split The % split of the balance to send to the address
*/
function _internalWithdraw(
uint256 _balance,
address _address,
uint256 _split
) private {
(bool success, ) = payable(_address).call{
value: (_balance / 10000) * _split
}("");
require(success, "Transfer failed");
}
/**
* @notice Withdraw funds from the contract
* @dev Community wallet 39.25%, Founder 18.22%, Design 15.19%, Story 15.19%, Dev 12.15%
* @dev Any balance left is sent to the community wallet
* @dev Prefer call pattern over transfer to prevent potential out of gas revert for multisigs
*/
function withdraw() external nonReentrant {
uint256 balance = address(this).balance;
_internalWithdraw(balance, _w1, 10000);
(bool success, ) = payable(_w1).call{value: address(this).balance}("");
require(success, "Transfer failed");
}
/**
* @notice Declare support for interfaces used (IERC2981)
* @dev Overrides {IERC165-supportsInterface}
* @return bool Whether a checked interface is supported or not
*/
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, IERC165)
returns (bool)
{
return
interfaceId == type(IERC2981).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @notice Set royalty info according to IERC2981 standard
* @dev Royalties paid to the community wallet
* @dev Overrides {IERC2981-royaltyInfo}
* @return address The royalties reciever
* @return royaltyAmount The amount to be paid
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
external
view
override
returns (address, uint256 royaltyAmount)
{
require(_exists(_tokenId), "Non-existent token");
royaltyAmount = (_salePrice / 100) * (royaltyPercentage / 10);
return (_w1, royaltyAmount);
}
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
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() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
IERC2981.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// 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;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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 virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @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) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
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 overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_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 {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_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 {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @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`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* 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
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a 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 _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* 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, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
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`.
*
* 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;
/**
* @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 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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
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 `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 65 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
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
ListMintActive 0xf0ce79f3 → bool
MAX_PER_AL_WALLET 0x95a61357 → uint256
MAX_PER_OG_WALLET 0xee32b411 → uint256
MAX_PER_TX 0xf43a22dc → uint256
MAX_SUPPLY 0x32cb6b0c → uint256
PublicMintActive 0xcd902acf → bool
alPrice 0x1b8926a9 → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
contractURI 0xe8a3d485 → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
merkleRootAL 0xc0f67b0a → bytes32
merkleRootOG 0xad6cb319 → bytes32
mintBalance 0xd88cc3ff → uint256
name 0x06fdde03 → string
ogPrice 0x15f5d8a0 → uint256
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
royaltyPercentage 0x8a71bb2d → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenPrice 0x7ff9b596 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 23 functions
These functions modify contract state and require a wallet transaction to execute.
alMint 0x4614467d
uint256 _numberOfTokens
bytes32[] _merkleProof
approve 0x095ea7b3
address to
uint256 tokenId
ogMint 0x2b314dc6
uint256 _numberOfTokens
bytes32[] _merkleProof
publicMint 0x2db11544
uint256 _numberOfTokens
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setAlPrice 0xbf509b9d
uint256 _newTokenPrice
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _newBaseURI
setCommunityWallet 0x85d6bb81
address _newCommunityWallet
setContractURI 0x938e3d7b
string _newContractURI
setMerkleRootAL 0x22766e9d
bytes32 _newMerkleRoot
setMerkleRootOG 0xa58fdc11
bytes32 _newMerkleRoot
setOgPrice 0x83af79e7
uint256 _newTokenPrice
setRoyaltyPercentage 0x61ba27da
uint256 _royaltyPercentage
setTokenPrice 0x6a61e5fc
uint256 _newTokenPrice
teamClaim 0x6ae146c2
No parameters
toggleListMint 0x0069496e
No parameters
togglePublicMint 0x4047638d
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address