Address Contract Partially Verified
Address
0xce15EC0FbbEE22C2a069FE0483F968Ffe657335d
Balance
0 ETH
Nonce
1
Code Size
11343 bytes
Creator
0x388A68Bd...d2E7 at tx 0xbe8d4385...6f15f4
Indexed Transactions
0
Contract Bytecode
11343 bytes
0x60806040526004361061031a5760003560e01c806382447134116101ab578063b88d4fde116100f7578063d5abeb0111610095578063e985e9c51161006f578063e985e9c5146108c1578063f2fde38b1461090a578063f47a437a1461092a578063fe04bd9b1461094057600080fd5b8063d5abeb011461086b578063e0a8085314610881578063e2af30f4146108a157600080fd5b8063c1ab22ec116100d1578063c1ab22ec1461080a578063c737e73514610820578063c87b56dd14610836578063d547cfb71461085657600080fd5b8063b88d4fde146107b0578063bab257f3146107d0578063bce6d672146107f057600080fd5b806395d89b4111610164578063a0bcfc7f1161013e578063a0bcfc7f14610739578063a22cb46514610759578063a591252d14610779578063a5fe62e71461078f57600080fd5b806395d89b41146106ef578063a0712d6814610704578063a0b7cd851461071757600080fd5b806382447134146106545780638ab53447146106745780638cc54e7f1461067c5780638da5cb5b1461069157806391b7f5ed146106af578063958f7fcc146106cf57600080fd5b80633d8ff2f41161026a5780636352211e116102235780636f8b44b0116101fd5780636f8b44b0146105df57806370a08231146105ff578063715018a61461061f578063742a4c9b1461063457600080fd5b80636352211e146105935780636817c76c146105b357806368a4bd24146105c957600080fd5b80633d8ff2f4146104eb5780633f815b9a146104fe57806342842e0e1461051e5780634f6ccce71461053e578063518302271461055e57806357f55a051461057d57600080fd5b806316dad380116102d757806323b872dd116102b157806323b872dd14610476578063248b71fc146104965780632f745c59146104b65780633ccfd60b146104d657600080fd5b806316dad3801461041457806318160ddd1461043457806318cae2691461044957600080fd5b806301ffc9a71461031f5780630426c1fa1461035457806306fdde0314610376578063081812fc14610398578063095ea7b3146103d057806310fb2825146103f0575b600080fd5b34801561032b57600080fd5b5061033f61033a366004612557565b610956565b60405190151581526020015b60405180910390f35b34801561036057600080fd5b5061037461036f36600461257b565b6109c3565b005b34801561038257600080fd5b5061038b6109fb565b60405161034b91906125ec565b3480156103a457600080fd5b506103b86103b336600461257b565b610a8d565b6040516001600160a01b03909116815260200161034b565b3480156103dc57600080fd5b506103746103eb36600461261b565b610b18565b3480156103fc57600080fd5b50610406600b5481565b60405190815260200161034b565b34801561042057600080fd5b5060145461033f9062010000900460ff1681565b34801561044057600080fd5b50600054610406565b34801561045557600080fd5b50610406610464366004612645565b60156020526000908152604090205481565b34801561048257600080fd5b50610374610491366004612660565b610c2f565b3480156104a257600080fd5b506103746104b136600461261b565b610c3a565b3480156104c257600080fd5b506104066104d136600461261b565b610ca1565b3480156104e257600080fd5b50610374610e0d565b6103746104f936600461257b565b610e73565b34801561050a57600080fd5b506103746105193660046126ac565b611006565b34801561052a57600080fd5b50610374610539366004612660565b61104c565b34801561054a57600080fd5b5061040661055936600461257b565b611067565b34801561056a57600080fd5b5060145461033f90610100900460ff1681565b34801561058957600080fd5b50610406600d5481565b34801561059f57600080fd5b506103b86105ae36600461257b565b6110c9565b3480156105bf57600080fd5b5061040660085481565b3480156105d557600080fd5b50610406600a5481565b3480156105eb57600080fd5b506103746105fa36600461257b565b6110db565b34801561060b57600080fd5b5061040661061a366004612645565b61110a565b34801561062b57600080fd5b5061037461119b565b34801561064057600080fd5b5061037461064f36600461257b565b6111d1565b34801561066057600080fd5b5061037461066f3660046126c7565b611200565b61037461125d565b34801561068857600080fd5b5061038b6113e8565b34801561069d57600080fd5b506007546001600160a01b03166103b8565b3480156106bb57600080fd5b506103746106ca36600461257b565b611476565b3480156106db57600080fd5b506103746106ea3660046126ac565b6114a5565b3480156106fb57600080fd5b5061038b6114ed565b61037461071236600461257b565b6114fc565b34801561072357600080fd5b5060145461033f90640100000000900460ff1681565b34801561074557600080fd5b5061037461075436600461277f565b6115cb565b34801561076557600080fd5b506103746107743660046127c8565b611608565b34801561078557600080fd5b5061040660105481565b34801561079b57600080fd5b5060145461033f906301000000900460ff1681565b3480156107bc57600080fd5b506103746107cb3660046127fb565b6116cc565b3480156107dc57600080fd5b506103746107eb3660046126ac565b611705565b3480156107fc57600080fd5b5060145461033f9060ff1681565b34801561081657600080fd5b5061040660115481565b34801561082c57600080fd5b5061040660095481565b34801561084257600080fd5b5061038b61085136600461257b565b61174f565b34801561086257600080fd5b5061038b611898565b34801561087757600080fd5b50610406600f5481565b34801561088d57600080fd5b5061037461089c3660046126ac565b6118a5565b3480156108ad57600080fd5b506103746108bc3660046126ac565b6118e9565b3480156108cd57600080fd5b5061033f6108dc366004612877565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b34801561091657600080fd5b50610374610925366004612645565b611926565b34801561093657600080fd5b50610406600e5481565b34801561094c57600080fd5b50610406600c5481565b60006001600160e01b031982166380ac58cd60e01b148061098757506001600160e01b03198216635b5e139f60e01b145b806109a257506001600160e01b0319821663780e9d6360e01b145b806109bd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6007546001600160a01b031633146109f65760405162461bcd60e51b81526004016109ed906128a1565b60405180910390fd5b601155565b606060018054610a0a906128d6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a36906128d6565b8015610a835780601f10610a5857610100808354040283529160200191610a83565b820191906000526020600020905b815481529060010190602001808311610a6657829003601f168201915b5050505050905090565b6000610a9a826000541190565b610afc5760405162461bcd60e51b815260206004820152602d60248201527f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560448201526c3c34b9ba32b73a103a37b5b2b760991b60648201526084016109ed565b506000908152600560205260409020546001600160a01b031690565b6000610b23826110c9565b9050806001600160a01b0316836001600160a01b031603610b915760405162461bcd60e51b815260206004820152602260248201527f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60448201526132b960f11b60648201526084016109ed565b336001600160a01b0382161480610bad5750610bad81336108dc565b610c1f5760405162461bcd60e51b815260206004820152603960248201527f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656420666f7220616c6c0000000000000060648201526084016109ed565b610c2a8383836119be565b505050565b610c2a838383611a1a565b6007546001600160a01b03163314610c645760405162461bcd60e51b81526004016109ed906128a1565b600f5481600054610c759190612926565b1115610c935760405162461bcd60e51b81526004016109ed9061293e565b610c9d8282611d61565b5050565b6000610cac8361110a565b8210610d055760405162461bcd60e51b815260206004820152602260248201527f455243373231413a206f776e657220696e646578206f7574206f6620626f756e604482015261647360f01b60648201526084016109ed565b600080549080805b83811015610dad576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215610d6057805192505b876001600160a01b0316836001600160a01b031603610d9a57868403610d8c575093506109bd92505050565b83610d968161296c565b9450505b5080610da58161296c565b915050610d0d565b5060405162461bcd60e51b815260206004820152602e60248201527f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060448201526d0deeedccae440c4f240d2dcc8caf60931b60648201526084016109ed565b6007546001600160a01b03163314610e375760405162461bcd60e51b81526004016109ed906128a1565b6007546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610e70573d6000803e3d6000fd5b50565b60145460ff16610e955760405162461bcd60e51b81526004016109ed90612985565b6014546301000000900460ff16610f025760405162461bcd60e51b815260206004820152602b60248201527f496e76616c6964204d696e742c205061636b676167652070726f6d6f74696f6e60448201526a2068617320656e6465642160a81b60648201526084016109ed565b6008546000906001839003610f1e575050600954600a54610f44565b82600203610f33575050600b54600c54610f44565b82600303610f44575050600d54600e545b60008211610f875760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f206d696e742160801b60448201526064016109ed565b80341015610fcd5760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b60448201526064016109ed565b600f5482600054610fde9190612926565b1115610ffc5760405162461bcd60e51b81526004016109ed9061293e565b610c2a3383611d61565b6007546001600160a01b031633146110305760405162461bcd60e51b81526004016109ed906128a1565b60148054911515620100000262ff000019909216919091179055565b610c2a838383604051806020016040528060008152506116cc565b6000805482106110c55760405162461bcd60e51b815260206004820152602360248201527f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f756044820152626e647360e81b60648201526084016109ed565b5090565b60006110d482611d7b565b5192915050565b6007546001600160a01b031633146111055760405162461bcd60e51b81526004016109ed906128a1565b600f55565b60006001600160a01b0382166111765760405162461bcd60e51b815260206004820152602b60248201527f455243373231413a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084016109ed565b506001600160a01b03166000908152600460205260409020546001600160801b031690565b6007546001600160a01b031633146111c55760405162461bcd60e51b81526004016109ed906128a1565b6111cf6000611f25565b565b6007546001600160a01b031633146111fb5760405162461bcd60e51b81526004016109ed906128a1565b601055565b6007546001600160a01b0316331461122a5760405162461bcd60e51b81526004016109ed906128a1565b8260010361123b57600955600a5550565b8260020361124c57600b55600c5550565b82600303610c2a57600d55600e5550565b60145460ff1661127f5760405162461bcd60e51b81526004016109ed90612985565b60145462010000900460ff166112e65760405162461bcd60e51b815260206004820152602660248201527f54686520636f6e7472616374206973206e6f74206f70656e20666f722066726560448201526519481b5a5b9d60d21b60648201526084016109ed565b6011546112f23361110a565b1061134a5760405162461bcd60e51b815260206004820152602260248201527f4d61782066726565206d696e74207065722077616c6c65742065786365656465604482015261642160f01b60648201526084016109ed565b60105460115460005461135d9190612926565b11156113ab5760405162461bcd60e51b815260206004820152601760248201527f4d61782066726565206d696e742065786365656465642100000000000000000060448201526064016109ed565b600f546011546000546113be9190612926565b11156113dc5760405162461bcd60e51b81526004016109ed9061293e565b6111cf33601154611d61565b601380546113f5906128d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611421906128d6565b801561146e5780601f106114435761010080835404028352916020019161146e565b820191906000526020600020905b81548152906001019060200180831161145157829003601f168201915b505050505081565b6007546001600160a01b031633146114a05760405162461bcd60e51b81526004016109ed906128a1565b600855565b6007546001600160a01b031633146114cf5760405162461bcd60e51b81526004016109ed906128a1565b6014805491151563010000000263ff00000019909216919091179055565b606060028054610a0a906128d6565b60145460ff1661151e5760405162461bcd60e51b81526004016109ed90612985565b8060085461152c91906129ca565b3410156115715760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742066756e64732160681b60448201526064016109ed565b601454640100000000900460ff16156115925761158f8160026129ca565b90505b600f54816000546115a39190612926565b11156115c15760405162461bcd60e51b81526004016109ed9061293e565b610e703382611d61565b6007546001600160a01b031633146115f55760405162461bcd60e51b81526004016109ed906128a1565b8051610c9d9060129060208401906124b1565b336001600160a01b038316036116605760405162461bcd60e51b815260206004820152601a60248201527f455243373231413a20617070726f766520746f2063616c6c657200000000000060448201526064016109ed565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6116d7848484611a1a565b6116e384848484611f77565b6116ff5760405162461bcd60e51b81526004016109ed906129e9565b50505050565b6007546001600160a01b0316331461172f5760405162461bcd60e51b81526004016109ed906128a1565b601480549115156401000000000264ff0000000019909216919091179055565b606061175c826000541190565b6117c05760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109ed565b601454610100900460ff16151560000361186657601380546117e1906128d6565b80601f016020809104026020016040519081016040528092919081815260200182805461180d906128d6565b801561185a5780601f1061182f5761010080835404028352916020019161185a565b820191906000526020600020905b81548152906001019060200180831161183d57829003601f168201915b50505050509050919050565b601261187183612079565b604051602001611882929190612a58565b6040516020818303038152906040529050919050565b601280546113f5906128d6565b6007546001600160a01b031633146118cf5760405162461bcd60e51b81526004016109ed906128a1565b601480549115156101000261ff0019909216919091179055565b6007546001600160a01b031633146119135760405162461bcd60e51b81526004016109ed906128a1565b6014805460ff1916911515919091179055565b6007546001600160a01b031633146119505760405162461bcd60e51b81526004016109ed906128a1565b6001600160a01b0381166119b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109ed565b610e7081611f25565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611a2582611d7b565b80519091506000906001600160a01b0316336001600160a01b03161480611a5c575033611a5184610a8d565b6001600160a01b0316145b80611a6e57508151611a6e90336108dc565b905080611ad85760405162461bcd60e51b815260206004820152603260248201527f455243373231413a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016109ed565b846001600160a01b031682600001516001600160a01b031614611b4c5760405162461bcd60e51b815260206004820152602660248201527f455243373231413a207472616e736665722066726f6d20696e636f72726563746044820152651037bbb732b960d11b60648201526084016109ed565b6001600160a01b038416611bb05760405162461bcd60e51b815260206004820152602560248201527f455243373231413a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016109ed565b611bc060008484600001516119be565b6001600160a01b03858116600090815260046020908152604080832080546fffffffffffffffffffffffffffffffff198082166001600160801b03928316600019018316179092558986168086528386208054938416938316600190810190931693909317909255825180840184529182524267ffffffffffffffff9081168386019081528a8752600390955292852091518254945196166001600160e01b031990941693909317600160a01b95909216949094021790925590611c85908590612926565b6000818152600360205260409020549091506001600160a01b0316611d1757611caf816000541190565b15611d175760408051808201825284516001600160a01b03908116825260208087015167ffffffffffffffff9081168285019081526000878152600390935294909120925183549451909116600160a01b026001600160e01b03199094169116179190911790555b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b610c9d82826040518060200160405280600081525061217a565b6040805180820190915260008082526020820152611d9a826000541190565b611df95760405162461bcd60e51b815260206004820152602a60248201527f455243373231413a206f776e657220717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b60648201526084016109ed565b60007f00000000000000000000000000000000000000000000000000000000000000648310611e5a57611e4c7f000000000000000000000000000000000000000000000000000000000000006484612b12565b611e57906001612926565b90505b825b818110611ec4576000818152600360209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910467ffffffffffffffff169183019190915215611eb157949350505050565b5080611ebc81612b29565b915050611e5c565b5060405162461bcd60e51b815260206004820152602f60248201527f455243373231413a20756e61626c6520746f2064657465726d696e652074686560448201526e1037bbb732b91037b3103a37b5b2b760891b60648201526084016109ed565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006001600160a01b0384163b1561206d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611fbb903390899088908890600401612b40565b6020604051808303816000875af1925050508015611ff6575060408051601f3d908101601f19168201909252611ff391810190612b7d565b60015b612053573d808015612024576040519150601f19603f3d011682016040523d82523d6000602084013e612029565b606091505b50805160000361204b5760405162461bcd60e51b81526004016109ed906129e9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612071565b5060015b949350505050565b6060816000036120a05750506040805180820190915260018152600360fc1b602082015290565b8160005b81156120ca57806120b48161296c565b91506120c39050600a83612bb0565b91506120a4565b60008167ffffffffffffffff8111156120e5576120e56126f3565b6040519080825280601f01601f19166020018201604052801561210f576020820181803683370190505b5090505b841561207157612124600183612b12565b9150612131600a86612bc4565b61213c906030612926565b60f81b81838151811061215157612151612bd8565b60200101906001600160f81b031916908160001a905350612173600a86612bb0565b9450612113565b6000546001600160a01b0384166121dd5760405162461bcd60e51b815260206004820152602160248201527f455243373231413a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016109ed565b6121e8816000541190565b156122355760405162461bcd60e51b815260206004820152601d60248201527f455243373231413a20746f6b656e20616c7265616479206d696e74656400000060448201526064016109ed565b7f00000000000000000000000000000000000000000000000000000000000000648311156122b05760405162461bcd60e51b815260206004820152602260248201527f455243373231413a207175616e7469747920746f206d696e7420746f6f2068696044820152610ced60f31b60648201526084016109ed565b6000831161230c5760405162461bcd60e51b815260206004820152602360248201527f455243373231413a207175616e74697479206d7573742062652067726561746560448201526207220360ec1b60648201526084016109ed565b6001600160a01b0384166000908152600460209081526040918290208251808401845290546001600160801b038082168352600160801b9091041691810191909152815180830190925280519091908190612368908790612bee565b6001600160801b031681526020018583602001516123869190612bee565b6001600160801b039081169091526001600160a01b0380881660008181526004602090815260408083208751978301518716600160801b0297909616969096179094558451808601865291825267ffffffffffffffff4281168386019081528883526003909552948120915182549451909516600160a01b026001600160e01b031990941694909216939093179190911790915582905b858110156124a65760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461246a6000888488611f77565b6124865760405162461bcd60e51b81526004016109ed906129e9565b816124908161296c565b925050808061249e9061296c565b91505061241d565b506000819055611d59565b8280546124bd906128d6565b90600052602060002090601f0160209004810192826124df5760008555612525565b82601f106124f857805160ff1916838001178555612525565b82800160010185558215612525579182015b8281111561252557825182559160200191906001019061250a565b506110c59291505b808211156110c5576000815560010161252d565b6001600160e01b031981168114610e7057600080fd5b60006020828403121561256957600080fd5b813561257481612541565b9392505050565b60006020828403121561258d57600080fd5b5035919050565b60005b838110156125af578181015183820152602001612597565b838111156116ff5750506000910152565b600081518084526125d8816020860160208601612594565b601f01601f19169290920160200192915050565b60208152600061257460208301846125c0565b80356001600160a01b038116811461261657600080fd5b919050565b6000806040838503121561262e57600080fd5b612637836125ff565b946020939093013593505050565b60006020828403121561265757600080fd5b612574826125ff565b60008060006060848603121561267557600080fd5b61267e846125ff565b925061268c602085016125ff565b9150604084013590509250925092565b8035801515811461261657600080fd5b6000602082840312156126be57600080fd5b6125748261269c565b6000806000606084860312156126dc57600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115612724576127246126f3565b604051601f8501601f19908116603f0116810190828211818310171561274c5761274c6126f3565b8160405280935085815286868601111561276557600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561279157600080fd5b813567ffffffffffffffff8111156127a857600080fd5b8201601f810184136127b957600080fd5b61207184823560208401612709565b600080604083850312156127db57600080fd5b6127e4836125ff565b91506127f26020840161269c565b90509250929050565b6000806000806080858703121561281157600080fd5b61281a856125ff565b9350612828602086016125ff565b925060408501359150606085013567ffffffffffffffff81111561284b57600080fd5b8501601f8101871361285c57600080fd5b61286b87823560208401612709565b91505092959194509250565b6000806040838503121561288a57600080fd5b612893836125ff565b91506127f2602084016125ff565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c908216806128ea57607f821691505b60208210810361290a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561293957612939612910565b500190565b6020808252601490820152734d617820737570706c792065786365656465642160601b604082015260600190565b60006001820161297e5761297e612910565b5060010190565b60208082526025908201527f54686520636f6e7472616374206973206e6f74206f70656e20746f206d696e74604082015264207965742160d81b606082015260800190565b60008160001904831182151516156129e4576129e4612910565b500290565b60208082526033908201527f455243373231413a207472616e7366657220746f206e6f6e204552433732315260408201527232b1b2b4bb32b91034b6b83632b6b2b73a32b960691b606082015260800190565b60008151612a4e818560208601612594565b9290920192915050565b600080845481600182811c915080831680612a7457607f831692505b60208084108203612a9357634e487b7160e01b86526022600452602486fd5b818015612aa75760018114612ab857612ae5565b60ff19861689528489019650612ae5565b60008b81526020902060005b86811015612add5781548b820152908501908301612ac4565b505084890196505b505050505050612b09612af88286612a3c565b64173539b7b760d91b815260050190565b95945050505050565b600082821015612b2457612b24612910565b500390565b600081612b3857612b38612910565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612b73908301846125c0565b9695505050505050565b600060208284031215612b8f57600080fd5b815161257481612541565b634e487b7160e01b600052601260045260246000fd5b600082612bbf57612bbf612b9a565b500490565b600082612bd357612bd3612b9a565b500690565b634e487b7160e01b600052603260045260246000fd5b60006001600160801b03808316818516808303821115612c1057612c10612910565b0194935050505056fea2646970667358221220492ac0799c94325dc1e74f5985dc63f21979fef0e847ca59dc3fb3b79748a50064736f6c634300080d0033
Verified Source Code Partial Match
Compiler: v0.8.13+commit.abaa5c0e
EVM: london
Optimization: Yes (200 runs)
FireMoonBirds.sol 1320 lines
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs
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);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
// File: contracts/LowerGas.sol
// Creator: Chiru Labs
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Does not support burning tokens to address(0).
*
* Assumes that an owner cannot have more than the 2**128 (max value of uint128) of supply
*/
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 internal currentIndex = 0;
uint256 internal immutable maxBatchSize;
// 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;
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_
) {
require(maxBatchSize_ > 0, 'ERC721A: max batch size must be nonzero');
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), 'ERC721A: global index out of bounds');
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
require(index < balanceOf(owner), 'ERC721A: owner index out of bounds');
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert('ERC721A: unable to get token of owner by index');
}
/**
* @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 ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), 'ERC721A: balance query for the zero address');
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(owner != address(0), 'ERC721A: number minted query for the zero address');
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
require(_exists(tokenId), 'ERC721A: owner query for nonexistent token');
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert('ERC721A: unable to determine the owner of token');
}
/**
* @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) {
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 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);
require(to != owner, 'ERC721A: approval to current owner');
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
'ERC721A: approve caller is not owner nor approved for all'
);
_approve(to, tokenId, owner);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), 'ERC721A: approved query for nonexistent token');
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), 'ERC721A: approve to caller');
_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 override {
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
'ERC721A: 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`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), 'ERC721A: mint to the zero address');
// We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
require(!_exists(startTokenId), 'ERC721A: token already minted');
require(quantity <= maxBatchSize, 'ERC721A: quantity to mint too high');
require(quantity > 0, 'ERC721A: quantity must be greater 0');
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
'ERC721A: transfer to non ERC721Receiver implementer'
);
updatedIndex++;
}
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);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(isApprovedOrOwner, 'ERC721A: transfer caller is not owner nor approved');
require(prevOwnership.addr == from, 'ERC721A: transfer from incorrect owner');
require(to != address(0), 'ERC721A: transfer to the zero address');
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner
_approve(address(0), tokenId, prevOwnership.addr);
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
unchecked {
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
}
_ownerships[tokenId] = TokenOwnership(to, 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;
if (_ownerships[nextTokenId].addr == address(0)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(prevOwnership.addr, prevOwnership.startTimestamp);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @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 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(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert('ERC721A: transfer to non ERC721Receiver implementer');
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
*
* 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`.
*/
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.
*
* 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` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
pragma solidity ^0.8.13;
contract FireMoonBirds is ERC721A, Ownable {
using Strings for uint256;
uint256 public mintPrice = 0.019 ether;
uint256 public package1Qty = 5;
uint256 public package1Price = 0.049 ether;
uint256 public package2Qty = 10;
uint256 public package2Price = 0.089 ether;
uint256 public package3Qty = 10;
uint256 public package3Price = 0.95 ether;
uint256 public maxSupply = 4888;
uint256 public maxFreeMint = 4888;
uint256 public freeMintPerWallet = 3;
string public baseTokenURI = "";
string public hiddenURI = "https://gateway.pinata.cloud/ipfs/QmPqCg4cQDwZ6avxpXSG7sV1X3c6vqjqSvNL1AADS8oq4h";
bool public openMint = false;
bool public revealed = false;
bool public onFreeMint = true;
bool public onPackageSale = true;
bool public on1Free1 = true;
mapping(address => uint256) public addressMintedBalance;
constructor() ERC721A("Fire Moon Birds", "firemoonbirds", 100) { }
function mintPackage(uint256 _packageNumber) external payable {
require(openMint, "The contract is not open to mint yet!");
require(onPackageSale, "Invalid Mint, Packgage promotion has ended!");
uint256 _mintAmount = 0;
uint256 _packagePrice = mintPrice;
if(_packageNumber == 1) {
_mintAmount = package1Qty;
_packagePrice = package1Price;
}
else if(_packageNumber == 2) {
_mintAmount = package2Qty;
_packagePrice = package2Price;
}
else if(_packageNumber == 3) {
_mintAmount = package3Qty;
_packagePrice = package3Price;
}
require(_mintAmount > 0, "Nothing to mint!");
require(msg.value >= _packagePrice, "Insufficient funds!");
require(currentIndex + _mintAmount <= maxSupply, "Max supply exceeded!");
_safeMint(msg.sender, _mintAmount);
}
function mintFree() external payable {
require(openMint, "The contract is not open to mint yet!");
require(onFreeMint, "The contract is not open for free mint");
require(balanceOf(_msgSender()) < freeMintPerWallet, "Max free mint per wallet exceeded!");
require(currentIndex + freeMintPerWallet <= maxFreeMint, "Max free mint exceeded!");
require(currentIndex + freeMintPerWallet <= maxSupply, "Max supply exceeded!");
_safeMint(msg.sender, freeMintPerWallet);
}
function mint(uint256 _mintAmount) external payable {
require(openMint, "The contract is not open to mint yet!");
require(msg.value >= mintPrice * _mintAmount, "Insufficient funds!");
if(on1Free1){
_mintAmount = _mintAmount * 2;
}
require(currentIndex + _mintAmount <= maxSupply, "Max supply exceeded!");
_safeMint(msg.sender, _mintAmount);
}
function mintBatch(address _to, uint256 _mintAmount) public onlyOwner {
require(currentIndex + _mintAmount <= maxSupply, "Max supply exceeded!");
_safeMint(_to, _mintAmount);
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(_tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
if (revealed == false) {
return hiddenURI;
}
return string(abi.encodePacked(baseTokenURI, Strings.toString(_tokenId), ".json"));
}
function withdraw() external onlyOwner {
payable(owner()).transfer(address(this).balance);
}
function setPackage(uint256 _packageNumber, uint256 _packagePrice, uint256 _packageQty) external onlyOwner {
if(_packageNumber == 1){
package1Qty = _packageQty;
package1Price = _packagePrice;
}
else if(_packageNumber == 2){
package2Qty = _packageQty;
package2Price = _packagePrice;
}
else if(_packageNumber == 3){
package3Qty = _packageQty;
package3Price = _packagePrice;
}
}
function setMaxFreeMint(uint256 _maxFreeMint) public onlyOwner {
maxFreeMint = _maxFreeMint;
}
function setMaxSupply(uint256 _maxSupply) public onlyOwner {
maxSupply = _maxSupply;
}
function setFreeMintPerWallet(uint256 _freeMintPerWallet) public onlyOwner {
freeMintPerWallet = _freeMintPerWallet;
}
function setBaseUri(string memory _uri) external onlyOwner {
baseTokenURI = _uri;
}
function setOn1Free1(bool _state) public onlyOwner {
on1Free1 = _state;
}
function setOnPackageSale(bool _state) public onlyOwner {
onPackageSale = _state;
}
function setFreeMint(bool _state) public onlyOwner {
onFreeMint = _state;
}
function setOpenMint(bool _state) public onlyOwner {
openMint = _state;
}
function setRevealed(bool _state) public onlyOwner {
revealed = _state;
}
function setPrice(uint256 _price) public onlyOwner {
mintPrice = _price;
}
}
Read Contract
addressMintedBalance 0x18cae269 → uint256
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
freeMintPerWallet 0xc1ab22ec → uint256
getApproved 0x081812fc → address
hiddenURI 0x8cc54e7f → string
isApprovedForAll 0xe985e9c5 → bool
maxFreeMint 0xa591252d → uint256
maxSupply 0xd5abeb01 → uint256
mintPrice 0x6817c76c → uint256
name 0x06fdde03 → string
on1Free1 0xa0b7cd85 → bool
onFreeMint 0x16dad380 → bool
onPackageSale 0xa5fe62e7 → bool
openMint 0xbce6d672 → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
package1Price 0x68a4bd24 → uint256
package1Qty 0xc737e735 → uint256
package2Price 0xfe04bd9b → uint256
package2Qty 0x10fb2825 → uint256
package3Price 0xf47a437a → uint256
package3Qty 0x57f55a05 → uint256
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
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
mint 0xa0712d68
uint256 _mintAmount
mintBatch 0x248b71fc
address _to
uint256 _mintAmount
mintFree 0x8ab53447
No parameters
mintPackage 0x3d8ff2f4
uint256 _packageNumber
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 0xa0bcfc7f
string _uri
setFreeMint 0x3f815b9a
bool _state
setFreeMintPerWallet 0x0426c1fa
uint256 _freeMintPerWallet
setMaxFreeMint 0x742a4c9b
uint256 _maxFreeMint
setMaxSupply 0x6f8b44b0
uint256 _maxSupply
setOn1Free1 0xbab257f3
bool _state
setOnPackageSale 0x958f7fcc
bool _state
setOpenMint 0xe2af30f4
bool _state
setPackage 0x82447134
uint256 _packageNumber
uint256 _packagePrice
uint256 _packageQty
setPrice 0x91b7f5ed
uint256 _price
setRevealed 0xe0a80853
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address