Address Contract Verified
Address
0x778eFC5961570158dF0989aD7c9369cA23383adC
Balance
0.420000 ETH
Nonce
1
Code Size
15395 bytes
Creator
0xeee8cA7E...0e94 at tx 0x3710dbb8...697335
Indexed Transactions
0
Contract Bytecode
15395 bytes
0x6080604052600436106101d15760003560e01c80638da5cb5b116100f7578063cd7c032611610095578063ddca3f4311610064578063ddca3f431461063a578063e8a3d48514610665578063e985e9c514610690578063f2fde38b146106cd576101d8565b8063cd7c0326146105b1578063d0db5083146105dc578063d26ea6c0146105e6578063d547cfb71461060f576101d8565b80639dfb2adf116100d15780639dfb2adf14610506578063a22cb46514610522578063b88d4fde1461054b578063c87b56dd14610574576101d8565b80638da5cb5b14610487578063938e3d7b146104b257806395d89b41146104db576101d8565b806332cb6b0c1161016f5780636352211e1161013e5780636352211e146103cd57806369fe0e2d1461040a57806370a0823114610433578063715018a614610470576101d8565b806332cb6b0c146103255780633ccfd60b1461035057806342842e0e146103675780634f558e7914610390576101d8565b8063095ea7b3116101ab578063095ea7b31461027f57806318160ddd146102a857806323b872dd146102d357806330176e13146102fc576101d8565b806301ffc9a7146101da57806306fdde0314610217578063081812fc14610242576101d8565b366101d857005b005b3480156101e657600080fd5b5061020160048036038101906101fc91906129b6565b6106f6565b60405161020e9190612f6a565b60405180910390f35b34801561022357600080fd5b5061022c6107d8565b6040516102399190612f85565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612a72565b61086a565b6040516102769190612f03565b60405180910390f35b34801561028b57600080fd5b506102a660048036038101906102a1919061297a565b6108ef565b005b3480156102b457600080fd5b506102bd610a07565b6040516102ca9190613249565b60405180910390f35b3480156102df57600080fd5b506102fa60048036038101906102f59190612874565b610a24565b005b34801561030857600080fd5b50610323600480360381019061031e9190612a31565b610a84565b005b34801561033157600080fd5b5061033a610b51565b6040516103479190613249565b60405180910390f35b34801561035c57600080fd5b50610365610b57565b005b34801561037357600080fd5b5061038e60048036038101906103899190612874565b610d0f565b005b34801561039c57600080fd5b506103b760048036038101906103b29190612a72565b610d2f565b6040516103c49190612f6a565b60405180910390f35b3480156103d957600080fd5b506103f460048036038101906103ef9190612a72565b610d41565b6040516104019190612f03565b60405180910390f35b34801561041657600080fd5b50610431600480360381019061042c9190612a72565b610df3565b005b34801561043f57600080fd5b5061045a6004803603810190610455919061280f565b610eaf565b6040516104679190613249565b60405180910390f35b34801561047c57600080fd5b50610485610f67565b005b34801561049357600080fd5b5061049c610fef565b6040516104a99190612f03565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612a31565b611019565b005b3480156104e757600080fd5b506104f06110e7565b6040516104fd9190612f85565b60405180910390f35b610520600480360381019061051b919061280f565b611179565b005b34801561052e57600080fd5b506105496004803603810190610544919061293e565b61122f565b005b34801561055757600080fd5b50610572600480360381019061056d91906128c3565b611245565b005b34801561058057600080fd5b5061059b60048036038101906105969190612a72565b6112a7565b6040516105a89190612f85565b60405180910390f35b3480156105bd57600080fd5b506105c661134e565b6040516105d39190612f03565b60405180910390f35b6105e4611374565b005b3480156105f257600080fd5b5061060d6004803603810190610608919061280f565b611386565b005b34801561061b57600080fd5b50610624611489565b6040516106319190612f85565b60405180910390f35b34801561064657600080fd5b5061064f611517565b60405161065c9190613249565b60405180910390f35b34801561067157600080fd5b5061067a61151d565b6040516106879190612f85565b60405180910390f35b34801561069c57600080fd5b506106b760048036038101906106b29190612838565b6115ab565b6040516106c49190612f6a565b60405180910390f35b3480156106d957600080fd5b506106f460048036038101906106ef919061280f565b6116ad565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107c157507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806107d157506107d0826117bb565b5b9050919050565b6060600080546107e7906134d1565b80601f0160208091040260200160405190810160405280929190818152602001828054610813906134d1565b80156108605780601f1061083557610100808354040283529160200191610860565b820191906000526020600020905b81548152906001019060200180831161084357829003601f168201915b5050505050905090565b600061087582611825565b6108b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ab90613129565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006108fa82610d41565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561096b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096290613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661098a611891565b73ffffffffffffffffffffffffffffffffffffffff1614806109b957506109b8816109b3611891565b6115ab565b5b6109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef906130a9565b60405180910390fd5b610a028383611899565b505050565b60006001610a15600c611952565b610a1f91906133d5565b905090565b610a35610a2f611891565b82611960565b610a74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6b906131c9565b60405180910390fd5b610a7f838383611a3e565b505050565b610a8c611891565b73ffffffffffffffffffffffffffffffffffffffff16610aaa610fef565b73ffffffffffffffffffffffffffffffffffffffff1614610b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af790613149565b60405180910390fd5b80600a9080519060200190610b1692919061261e565b507f199e933997358e1789d8b56ea8c551befeb05ce2fe3fe506199f1230f5a591b481604051610b469190612f85565b60405180910390a150565b60075481565b610b5f611891565b73ffffffffffffffffffffffffffffffffffffffff16610b7d610fef565b73ffffffffffffffffffffffffffffffffffffffff1614610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca90613149565b60405180910390fd5b60004711610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90613209565b60405180910390fd5b6000610c20610fef565b73ffffffffffffffffffffffffffffffffffffffff1647604051610c4390612eee565b60006040518083038185875af1925050503d8060008114610c80576040519150601f19603f3d011682016040523d82523d6000602084013e610c85565b606091505b5050905080610cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc0906131a9565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167ff67611512e0a2d90c96fd3f08dca4971bc45fba9dc679eabe839a32abbe58a8e60405160405180910390a250565b610d2a83838360405180602001604052806000815250611245565b505050565b6000610d3a82611825565b9050919050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de1906130e9565b60405180910390fd5b80915050919050565b610dfb611891565b73ffffffffffffffffffffffffffffffffffffffff16610e19610fef565b73ffffffffffffffffffffffffffffffffffffffff1614610e6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6690613149565b60405180910390fd5b806008819055507e172ddfc5ae88d08b3de01a5a187667c37a5a53989e8c175055cb6c993792a781604051610ea49190613249565b60405180910390a150565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f17906130c9565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f6f611891565b73ffffffffffffffffffffffffffffffffffffffff16610f8d610fef565b73ffffffffffffffffffffffffffffffffffffffff1614610fe3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fda90613149565b60405180910390fd5b610fed6000611ca5565b565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611021611891565b73ffffffffffffffffffffffffffffffffffffffff1661103f610fef565b73ffffffffffffffffffffffffffffffffffffffff1614611095576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108c90613149565b60405180910390fd5b80600b90805190602001906110ab92919061261e565b507f5ca9f750836b0b7efdace104f07b5c9f0df0650c0fd24f5163e99044ae36ea52600b6040516110dc9190612fa7565b60405180910390a150565b6060600180546110f6906134d1565b80601f0160208091040260200160405190810160405280929190818152602001828054611122906134d1565b801561116f5780601f106111445761010080835404028352916020019161116f565b820191906000526020600020905b81548152906001019060200180831161115257829003601f168201915b5050505050905090565b6008543410156111be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b5906131e9565b60405180910390fd5b6007546111c9610a07565b10611209576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120090613229565b60405180910390fd5b6000611215600c611952565b90506112218282611d6b565b61122b600c6117a5565b5050565b61124161123a611891565b8383611d89565b5050565b611256611250611891565b83611960565b611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128c906131c9565b60405180910390fd5b6112a184848484611ef6565b50505050565b60606112b282611825565b6112f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e890613169565b60405180910390fd5b60006112fb611f52565b9050600081511161131b5760405180602001604052806000815250611346565b8061132584611fe4565b604051602001611336929190612eca565b6040516020818303038152906040525b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61138461137f611891565b611179565b565b61138e611891565b73ffffffffffffffffffffffffffffffffffffffff166113ac610fef565b73ffffffffffffffffffffffffffffffffffffffff1614611402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f990613149565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f191f22b6f37d18fc193c636df441fbe362909a26338c46a59122134ba99d91e860405160405180910390a250565b600a8054611496906134d1565b80601f01602080910402602001604051908101604052809291908181526020018280546114c2906134d1565b801561150f5780601f106114e45761010080835404028352916020019161150f565b820191906000526020600020905b8154815290600101906020018083116114f257829003601f168201915b505050505081565b60085481565b600b805461152a906134d1565b80601f0160208091040260200160405190810160405280929190818152602001828054611556906134d1565b80156115a35780601f10611578576101008083540402835291602001916115a3565b820191906000526020600020905b81548152906001019060200180831161158657829003601f168201915b505050505081565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1663c4552791866040518263ffffffff1660e01b81526004016116239190612f03565b60206040518083038186803b15801561163b57600080fd5b505afa15801561164f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116739190612a08565b73ffffffffffffffffffffffffffffffffffffffff1614156116995760019150506116a7565b6116a38484612191565b9150505b92915050565b6116b5611891565b73ffffffffffffffffffffffffffffffffffffffff166116d3610fef565b73ffffffffffffffffffffffffffffffffffffffff1614611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613149565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611799576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179090612fe9565b60405180910390fd5b6117a281611ca5565b50565b6001816000016000828254019250508190555050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661190c83610d41565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b600061196b82611825565b6119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a190613089565b60405180910390fd5b60006119b583610d41565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611a2457508373ffffffffffffffffffffffffffffffffffffffff16611a0c8461086a565b73ffffffffffffffffffffffffffffffffffffffff16145b80611a355750611a3481856115ab565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611a5e82610d41565b73ffffffffffffffffffffffffffffffffffffffff1614611ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aab90613009565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1b90613049565b60405180910390fd5b611b2f838383612225565b611b3a600082611899565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b8a91906133d5565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611be1919061334e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611ca083838361222a565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611d8582826040518060200160405280600081525061222f565b5050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611df8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611def90613069565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611ee99190612f6a565b60405180910390a3505050565b611f01848484611a3e565b611f0d8484848461228a565b611f4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4390612fc9565b60405180910390fd5b50505050565b6060600a8054611f61906134d1565b80601f0160208091040260200160405190810160405280929190818152602001828054611f8d906134d1565b8015611fda5780601f10611faf57610100808354040283529160200191611fda565b820191906000526020600020905b815481529060010190602001808311611fbd57829003601f168201915b5050505050905090565b6060600082141561202c576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061218c565b600082905060005b6000821461205e57808061204790613534565b915050600a8261205791906133a4565b9150612034565b60008167ffffffffffffffff8111156120a0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156120d25781602001600182028036833780820191505090505b5090505b60008514612185576001826120eb91906133d5565b9150600a856120fa919061357d565b6030612106919061334e565b60f81b818381518110612142577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561217e91906133a4565b94506120d6565b8093505050505b919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b505050565b505050565b6122398383612421565b612246600084848461228a565b612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c90612fc9565b60405180910390fd5b505050565b60006122ab8473ffffffffffffffffffffffffffffffffffffffff166125fb565b15612414578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026122d4611891565b8786866040518563ffffffff1660e01b81526004016122f69493929190612f1e565b602060405180830381600087803b15801561231057600080fd5b505af192505050801561234157506040513d601f19601f8201168201806040525081019061233e91906129df565b60015b6123c4573d8060008114612371576040519150601f19603f3d011682016040523d82523d6000602084013e612376565b606091505b506000815114156123bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b390612fc9565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612419565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248890613109565b60405180910390fd5b61249a81611825565b156124da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124d190613029565b60405180910390fd5b6124e660008383612225565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612536919061334e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46125f76000838361222a565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b82805461262a906134d1565b90600052602060002090601f01602090048101928261264c5760008555612693565b82601f1061266557805160ff1916838001178555612693565b82800160010185558215612693579182015b82811115612692578251825591602001919060010190612677565b5b5090506126a091906126a4565b5090565b5b808211156126bd5760008160009055506001016126a5565b5090565b60006126d46126cf84613289565b613264565b9050828152602081018484840111156126ec57600080fd5b6126f784828561348f565b509392505050565b600061271261270d846132ba565b613264565b90508281526020810184848401111561272a57600080fd5b61273584828561348f565b509392505050565b60008135905061274c81613b7a565b92915050565b60008135905061276181613b91565b92915050565b60008135905061277681613ba8565b92915050565b60008151905061278b81613ba8565b92915050565b600082601f8301126127a257600080fd5b81356127b28482602086016126c1565b91505092915050565b6000815190506127ca81613bbf565b92915050565b600082601f8301126127e157600080fd5b81356127f18482602086016126ff565b91505092915050565b60008135905061280981613bd6565b92915050565b60006020828403121561282157600080fd5b600061282f8482850161273d565b91505092915050565b6000806040838503121561284b57600080fd5b60006128598582860161273d565b925050602061286a8582860161273d565b9150509250929050565b60008060006060848603121561288957600080fd5b60006128978682870161273d565b93505060206128a88682870161273d565b92505060406128b9868287016127fa565b9150509250925092565b600080600080608085870312156128d957600080fd5b60006128e78782880161273d565b94505060206128f88782880161273d565b9350506040612909878288016127fa565b925050606085013567ffffffffffffffff81111561292657600080fd5b61293287828801612791565b91505092959194509250565b6000806040838503121561295157600080fd5b600061295f8582860161273d565b925050602061297085828601612752565b9150509250929050565b6000806040838503121561298d57600080fd5b600061299b8582860161273d565b92505060206129ac858286016127fa565b9150509250929050565b6000602082840312156129c857600080fd5b60006129d684828501612767565b91505092915050565b6000602082840312156129f157600080fd5b60006129ff8482850161277c565b91505092915050565b600060208284031215612a1a57600080fd5b6000612a28848285016127bb565b91505092915050565b600060208284031215612a4357600080fd5b600082013567ffffffffffffffff811115612a5d57600080fd5b612a69848285016127d0565b91505092915050565b600060208284031215612a8457600080fd5b6000612a92848285016127fa565b91505092915050565b612aa481613409565b82525050565b612ab38161341b565b82525050565b6000612ac482613300565b612ace8185613316565b9350612ade81856020860161349e565b612ae78161366a565b840191505092915050565b6000612afd8261330b565b612b078185613332565b9350612b1781856020860161349e565b612b208161366a565b840191505092915050565b6000612b368261330b565b612b408185613343565b9350612b5081856020860161349e565b80840191505092915050565b60008154612b69816134d1565b612b738186613332565b94506001821660008114612b8e5760018114612ba057612bd3565b60ff1983168652602086019350612bd3565b612ba9856132eb565b60005b83811015612bcb57815481890152600182019150602081019050612bac565b808801955050505b50505092915050565b6000612be9603283613332565b9150612bf48261367b565b604082019050919050565b6000612c0c602683613332565b9150612c17826136ca565b604082019050919050565b6000612c2f602583613332565b9150612c3a82613719565b604082019050919050565b6000612c52601c83613332565b9150612c5d82613768565b602082019050919050565b6000612c75602483613332565b9150612c8082613791565b604082019050919050565b6000612c98601983613332565b9150612ca3826137e0565b602082019050919050565b6000612cbb602c83613332565b9150612cc682613809565b604082019050919050565b6000612cde603883613332565b9150612ce982613858565b604082019050919050565b6000612d01602a83613332565b9150612d0c826138a7565b604082019050919050565b6000612d24602983613332565b9150612d2f826138f6565b604082019050919050565b6000612d47602083613332565b9150612d5282613945565b602082019050919050565b6000612d6a602c83613332565b9150612d758261396e565b604082019050919050565b6000612d8d602083613332565b9150612d98826139bd565b602082019050919050565b6000612db0602f83613332565b9150612dbb826139e6565b604082019050919050565b6000612dd3602183613332565b9150612dde82613a35565b604082019050919050565b6000612df6600f83613332565b9150612e0182613a84565b602082019050919050565b6000612e19600083613327565b9150612e2482613aad565b600082019050919050565b6000612e3c603183613332565b9150612e4782613ab0565b604082019050919050565b6000612e5f601083613332565b9150612e6a82613aff565b602082019050919050565b6000612e82601e83613332565b9150612e8d82613b28565b602082019050919050565b6000612ea5600a83613332565b9150612eb082613b51565b602082019050919050565b612ec481613485565b82525050565b6000612ed68285612b2b565b9150612ee28284612b2b565b91508190509392505050565b6000612ef982612e0c565b9150819050919050565b6000602082019050612f186000830184612a9b565b92915050565b6000608082019050612f336000830187612a9b565b612f406020830186612a9b565b612f4d6040830185612ebb565b8181036060830152612f5f8184612ab9565b905095945050505050565b6000602082019050612f7f6000830184612aaa565b92915050565b60006020820190508181036000830152612f9f8184612af2565b905092915050565b60006020820190508181036000830152612fc18184612b5c565b905092915050565b60006020820190508181036000830152612fe281612bdc565b9050919050565b6000602082019050818103600083015261300281612bff565b9050919050565b6000602082019050818103600083015261302281612c22565b9050919050565b6000602082019050818103600083015261304281612c45565b9050919050565b6000602082019050818103600083015261306281612c68565b9050919050565b6000602082019050818103600083015261308281612c8b565b9050919050565b600060208201905081810360008301526130a281612cae565b9050919050565b600060208201905081810360008301526130c281612cd1565b9050919050565b600060208201905081810360008301526130e281612cf4565b9050919050565b6000602082019050818103600083015261310281612d17565b9050919050565b6000602082019050818103600083015261312281612d3a565b9050919050565b6000602082019050818103600083015261314281612d5d565b9050919050565b6000602082019050818103600083015261316281612d80565b9050919050565b6000602082019050818103600083015261318281612da3565b9050919050565b600060208201905081810360008301526131a281612dc6565b9050919050565b600060208201905081810360008301526131c281612de9565b9050919050565b600060208201905081810360008301526131e281612e2f565b9050919050565b6000602082019050818103600083015261320281612e52565b9050919050565b6000602082019050818103600083015261322281612e75565b9050919050565b6000602082019050818103600083015261324281612e98565b9050919050565b600060208201905061325e6000830184612ebb565b92915050565b600061326e61327f565b905061327a8282613503565b919050565b6000604051905090565b600067ffffffffffffffff8211156132a4576132a361363b565b5b6132ad8261366a565b9050602081019050919050565b600067ffffffffffffffff8211156132d5576132d461363b565b5b6132de8261366a565b9050602081019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061335982613485565b915061336483613485565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613399576133986135ae565b5b828201905092915050565b60006133af82613485565b91506133ba83613485565b9250826133ca576133c96135dd565b5b828204905092915050565b60006133e082613485565b91506133eb83613485565b9250828210156133fe576133fd6135ae565b5b828203905092915050565b600061341482613465565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061345e82613409565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156134bc5780820151818401526020810190506134a1565b838111156134cb576000848401525b50505050565b600060028204905060018216806134e957607f821691505b602082108114156134fd576134fc61360c565b5b50919050565b61350c8261366a565b810181811067ffffffffffffffff8211171561352b5761352a61363b565b5b80604052505050565b600061353f82613485565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613572576135716135ae565b5b600182019050919050565b600061358882613485565b915061359383613485565b9250826135a3576135a26135dd565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e73666572204661696c65640000000000000000000000000000000000600082015250565b50565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f496e73756666696369656e742046656500000000000000000000000000000000600082015250565b7f4e6f7420456e6f7567682042616c616e6365204f6620436f6e74726163740000600082015250565b7f4d617820537570706c7900000000000000000000000000000000000000000000600082015250565b613b8381613409565b8114613b8e57600080fd5b50565b613b9a8161341b565b8114613ba557600080fd5b50565b613bb181613427565b8114613bbc57600080fd5b50565b613bc881613453565b8114613bd357600080fd5b50565b613bdf81613485565b8114613bea57600080fd5b5056fea2646970667358221220758fd5e98dee76c2206d650f9a447d5f75198e17d0a4e9120f8ff9c6a303193864736f6c63430008040033
Verified Source Code Full Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: No
BlueBirds.sol 207 lines
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
/**
* @title Delegate Proxy
* @notice delegate ownership of a contract to another address, to save on unneeded transactions to approve contract use for users
*/
contract OwnableDelegateProxy {
}
/**
* @title Proxy Registory
* @notice map address to the delegate proxy
*/
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
/**
* @author a42
* @title BlueBirds NFT
* @notice ERC721 contract
*/
contract BlueBirds is ERC721, Ownable {
/**
* Libraries
*/
using Counters for Counters.Counter;
/**
* Events
*/
event Withdraw(address indexed operator);
event SetBaseTokenURI(string baseTokenURI);
event SetContractURI(string contractURI);
event SetProxyRegistryAddress(address indexed proxyRegistryAddress);
event SetFee(uint256 fee);
/**
* Public Variables
*/
uint256 public MAX_SUPPLY = 10000;
uint256 public fee = 0.01 ether;
address public proxyRegistryAddress;
string public baseTokenURI;
string public contractURI;
/**
* Private Variables
*/
Counters.Counter private _totalSupply;
/**
* Constructor
* @notice Owner address will be automatically set to deployer address in the parent contract (Ownable)
* @param _baseTokenURI - base uri to be set as a initial baseURI
* @param _contractURI - base contract uri to be set as a initial _contractURI
* @param _proxyRegistryAddress - proxy address to be set as a initial proxyRegistryAddress
*/
constructor(
string memory _baseTokenURI,
string memory _contractURI,
address _proxyRegistryAddress
) ERC721("BLUEBIRDS", "BB") {
baseTokenURI = _baseTokenURI;
contractURI = _contractURI;
proxyRegistryAddress = _proxyRegistryAddress;
// _totalSupply is initialized to 1, since starting at 0 leads to higher gas cost for the first minter
_totalSupply.increment();
}
/**
* Receive function
*/
receive() external payable {}
/**
* Fallback function
*/
fallback() external payable {}
/**
* @notice update contractURI
* @param _contractURI - contract uri to be set as a new contractURI
*/
function setContractURI(string memory _contractURI) external onlyOwner {
contractURI = _contractURI;
emit SetContractURI(contractURI);
}
/**
* @notice Set base token uri for this contract
* @dev onlyOwner
* @param _baseTokenURI - string to be set as a new baseTokenURI
*/
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner {
baseTokenURI = _baseTokenURI;
emit SetBaseTokenURI(_baseTokenURI);
}
/**
* @notice Register proxy registry address
* @dev onlyOwner
* @param _proxyRegistryAddress - address to be set as a new proxyRegistryAddress
*/
function setProxyRegistryAddress(address _proxyRegistryAddress)
external
onlyOwner
{
proxyRegistryAddress = _proxyRegistryAddress;
emit SetProxyRegistryAddress(_proxyRegistryAddress);
}
/**
* @notice Set fee
* @dev onlyOwner
* @param _fee - fee to be set as a new fee
*/
function setFee(uint256 _fee) external onlyOwner {
fee = _fee;
emit SetFee(_fee);
}
/**
* @notice Transfer balance in contract to the owner address
* @dev onlyOwner
*/
function withdraw() external onlyOwner {
require(address(this).balance > 0, "Not Enough Balance Of Contract");
(bool success, ) = owner().call{value: address(this).balance}("");
require(success, "Transfer Failed");
emit Withdraw(msg.sender);
}
/**
* @notice Return totalSupply
* @return uint256
*/
function totalSupply() public view returns (uint256) {
return _totalSupply.current() - 1;
}
/**
* @notice Return bool if the token exists
* @param _tokenId - tokenId to be check if exists
* @return bool
*/
function exists(uint256 _tokenId) public view returns (bool) {
return _exists(_tokenId);
}
/**
* @notice Mint token to msg.sender
*/
function hatch() public payable {
hatchTo(_msgSender());
}
/**
* @notice Mint token to the beneficiary
* @param _beneficiary - address eligible to get the token
*/
function hatchTo(address _beneficiary) public payable {
require(msg.value >= fee, "Insufficient Fee");
require(totalSupply() < MAX_SUPPLY, "Max Supply");
uint256 tokenId = _totalSupply.current();
_safeMint(_beneficiary, tokenId);
_totalSupply.increment();
}
/**
* @notice Check if the owner approve the operator address
* @dev Override to allow proxy contracts for gas less approval
* @param _owner - owner address
* @param _operator - operator address
* @return bool
*/
function isApprovedForAll(address _owner, address _operator)
public
view
override
returns (bool)
{
// Whitelist OpenSea proxy contract for easy trading.
ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
if (address(proxyRegistry.proxies(_owner)) == _operator) {
return true;
}
return super.isApprovedForAll(_owner, _operator);
}
/**
* @notice See {ERC721-_baseURI}
* @dev Override to return baseTokenURI set by the owner
* @return string memory
*/
function _baseURI() internal view override returns (string memory) {
return baseTokenURI;
}
}
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);
}
}
Counters.sol 43 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
ERC721.sol 447 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 overriden 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 || getApproved(tokenId) == spender || isApprovedForAll(owner, 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 v4.4.1 (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`, 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;
}
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 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);
}
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
MAX_SUPPLY 0x32cb6b0c → uint256
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
contractURI 0xe8a3d485 → string
exists 0x4f558e79 → bool
fee 0xddca3f43 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
proxyRegistryAddress 0xcd7c0326 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
hatch 0xd0db5083
No parameters
hatchTo 0x9dfb2adf
address _beneficiary
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
setBaseTokenURI 0x30176e13
string _baseTokenURI
setContractURI 0x938e3d7b
string _contractURI
setFee 0x69fe0e2d
uint256 _fee
setProxyRegistryAddress 0xd26ea6c0
address _proxyRegistryAddress
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address