Address Contract Verified
Address
0x2Aa7bF999F50ef9773B290CB12434aa50a955746
Balance
0 ETH
Nonce
1
Code Size
20797 bytes
Creator
0x0AC5862C...1dDc at tx 0xa83435d9...9b942f
Indexed Transactions
0
Contract Bytecode
20797 bytes
0x6080604052600436106102515760003560e01c806370a0823111610139578063b88d4fde116100b6578063d755bf991161007a578063d755bf99146108b1578063e0a80853146108da578063e985e9c514610903578063f2fde38b14610940578063f51f96dd14610969578063f53a73601461099457610251565b8063b88d4fde146107ce578063bc337182146107f7578063c87b56dd14610820578063d26be2eb1461085d578063d5abeb011461088657610251565b80638ba4cc3c116100fd5780638ba4cc3c1461070a5780638da5cb5b1461073357806395d89b411461075e578063a0712d6814610789578063a22cb465146107a557610251565b806370a0823114610625578063715018a61461066257806371a34298146106795780637437681e146106b65780637ec4a659146106e157610251565b80633ccfd60b116101d25780634fdd43cb116101965780634fdd43cb14610515578063518302271461053e5780635c975abb146105695780635e1a2636146105945780636352211e146105bf5780636f8b44b0146105fc57610251565b80633ccfd60b1461043057806342842e0e14610447578063438b630014610470578063485a68a3146104ad5780634f6ccce7146104d857610251565b806318160ddd1161021957806318160ddd1461034d5780631919fed71461037857806323b872dd146103a15780632f745c59146103ca5780632fbba1151461040757610251565b806301ffc9a71461025657806306fdde0314610293578063081812fc146102be578063095ea7b3146102fb57806316c38b3c14610324575b600080fd5b34801561026257600080fd5b5061027d600480360381019061027891906135b2565b6109bf565b60405161028a91906135fa565b60405180910390f35b34801561029f57600080fd5b506102a8610b09565b6040516102b591906136a5565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e091906136fd565b610b9b565b6040516102f2919061376b565b60405180910390f35b34801561030757600080fd5b50610322600480360381019061031d91906137b2565b610c20565b005b34801561033057600080fd5b5061034b6004803603810190610346919061381e565b610d38565b005b34801561035957600080fd5b50610362610dd1565b60405161036f919061385a565b60405180910390f35b34801561038457600080fd5b5061039f600480360381019061039a91906136fd565b610dda565b005b3480156103ad57600080fd5b506103c860048036038101906103c39190613875565b610e60565b005b3480156103d657600080fd5b506103f160048036038101906103ec91906137b2565b610e70565b6040516103fe919061385a565b60405180910390f35b34801561041357600080fd5b5061042e600480360381019061042991906136fd565b611060565b005b34801561043c57600080fd5b50610445611140565b005b34801561045357600080fd5b5061046e60048036038101906104699190613875565b61126b565b005b34801561047c57600080fd5b50610497600480360381019061049291906138c8565b61128b565b6040516104a491906139b3565b60405180910390f35b3480156104b957600080fd5b506104c2611395565b6040516104cf919061385a565b60405180910390f35b3480156104e457600080fd5b506104ff60048036038101906104fa91906136fd565b61139b565b60405161050c919061385a565b60405180910390f35b34801561052157600080fd5b5061053c60048036038101906105379190613b0a565b6113ee565b005b34801561054a57600080fd5b5061055361147d565b60405161056091906135fa565b60405180910390f35b34801561057557600080fd5b5061057e611490565b60405161058b91906135fa565b60405180910390f35b3480156105a057600080fd5b506105a96114a3565b6040516105b6919061385a565b60405180910390f35b3480156105cb57600080fd5b506105e660048036038101906105e191906136fd565b6114a9565b6040516105f3919061376b565b60405180910390f35b34801561060857600080fd5b50610623600480360381019061061e91906136fd565b6114bf565b005b34801561063157600080fd5b5061064c600480360381019061064791906138c8565b611545565b604051610659919061385a565b60405180910390f35b34801561066e57600080fd5b5061067761162d565b005b34801561068557600080fd5b506106a0600480360381019061069b91906138c8565b61176a565b6040516106ad919061385a565b60405180910390f35b3480156106c257600080fd5b506106cb611782565b6040516106d8919061385a565b60405180910390f35b3480156106ed57600080fd5b5061070860048036038101906107039190613b0a565b611788565b005b34801561071657600080fd5b50610731600480360381019061072c91906137b2565b611817565b005b34801561073f57600080fd5b50610748611948565b604051610755919061376b565b60405180910390f35b34801561076a57600080fd5b50610773611972565b60405161078091906136a5565b60405180910390f35b6107a3600480360381019061079e91906136fd565b611a04565b005b3480156107b157600080fd5b506107cc60048036038101906107c79190613b53565b611dff565b005b3480156107da57600080fd5b506107f560048036038101906107f09190613c34565b611f7f565b005b34801561080357600080fd5b5061081e600480360381019061081991906136fd565b611fdb565b005b34801561082c57600080fd5b50610847600480360381019061084291906136fd565b612061565b60405161085491906136a5565b60405180910390f35b34801561086957600080fd5b50610884600480360381019061087f91906136fd565b6121b9565b005b34801561089257600080fd5b5061089b61223f565b6040516108a8919061385a565b60405180910390f35b3480156108bd57600080fd5b506108d860048036038101906108d391906136fd565b612245565b005b3480156108e657600080fd5b5061090160048036038101906108fc919061381e565b6122cb565b005b34801561090f57600080fd5b5061092a60048036038101906109259190613cb7565b612364565b60405161093791906135fa565b60405180910390f35b34801561094c57600080fd5b50610967600480360381019061096291906138c8565b6123f8565b005b34801561097557600080fd5b5061097e6125a3565b60405161098b919061385a565b60405180910390f35b3480156109a057600080fd5b506109a96125a9565b6040516109b6919061385a565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610a8a57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610af257507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b025750610b01826125af565b5b9050919050565b606060018054610b1890613d26565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4490613d26565b8015610b915780601f10610b6657610100808354040283529160200191610b91565b820191906000526020600020905b815481529060010190602001808311610b7457829003601f168201915b5050505050905090565b6000610ba682612619565b610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90613dc9565b60405180910390fd5b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c2b826114a9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610c9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9290613e5b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610cba612626565b73ffffffffffffffffffffffffffffffffffffffff161480610ce95750610ce881610ce3612626565b612364565b5b610d28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1f90613eed565b60405180910390fd5b610d3383838361262e565b505050565b610d40612626565b73ffffffffffffffffffffffffffffffffffffffff16610d5e611948565b73ffffffffffffffffffffffffffffffffffffffff1614610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab90613f59565b60405180910390fd5b80600b60006101000a81548160ff02191690831515021790555050565b60008054905090565b610de2612626565b73ffffffffffffffffffffffffffffffffffffffff16610e00611948565b73ffffffffffffffffffffffffffffffffffffffff1614610e56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4d90613f59565b60405180910390fd5b80600c8190555050565b610e6b8383836126e0565b505050565b6000610e7b83611545565b8210610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613feb565b60405180910390fd5b6000610ec6610dd1565b905060008060005b8381101561101e576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614610fc057806000015192505b8773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110105786840361100757819550505050505061105a565b83806001019450505b508080600101915050610ece565b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110519061407d565b60405180910390fd5b92915050565b611068612626565b73ffffffffffffffffffffffffffffffffffffffff16611086611948565b73ffffffffffffffffffffffffffffffffffffffff16146110dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d390613f59565b60405180910390fd5b601054816110e8610dd1565b6110f291906140cc565b1115611133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112a9061414c565b60405180910390fd5b61113d3382612c1e565b50565b611148612626565b73ffffffffffffffffffffffffffffffffffffffff16611166611948565b73ffffffffffffffffffffffffffffffffffffffff16146111bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b390613f59565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff16476040516111e29061419d565b60006040518083038185875af1925050503d806000811461121f576040519150601f19603f3d011682016040523d82523d6000602084013e611224565b606091505b5050905080611268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125f906141fe565b60405180910390fd5b50565b61128683838360405180602001604052806000815250611f7f565b505050565b6060600061129883611545565b905060008167ffffffffffffffff8111156112b6576112b56139df565b5b6040519080825280602002602001820160405280156112e45781602001602082028036833780820191505090505b50905060006001905060005b838110801561130157506010548211155b15611389576000611311836114a9565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611375578284838151811061135a5761135961421e565b5b60200260200101818152505081806113719061424d565b9250505b82806113809061424d565b935050506112f0565b82945050505050919050565b600d5481565b60006113a5610dd1565b82106113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd90614307565b60405180910390fd5b819050919050565b6113f6612626565b73ffffffffffffffffffffffffffffffffffffffff16611414611948565b73ffffffffffffffffffffffffffffffffffffffff161461146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146190613f59565b60405180910390fd5b80600a908161147991906144d3565b5050565b600b60019054906101000a900460ff1681565b600b60009054906101000a900460ff1681565b60115481565b60006114b482612c3c565b600001519050919050565b6114c7612626565b73ffffffffffffffffffffffffffffffffffffffff166114e5611948565b73ffffffffffffffffffffffffffffffffffffffff161461153b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153290613f59565b60405180910390fd5b8060108190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036115b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ac90614617565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b611635612626565b73ffffffffffffffffffffffffffffffffffffffff16611653611948565b73ffffffffffffffffffffffffffffffffffffffff16146116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a090613f59565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60126020528060005260406000206000915090505481565b600e5481565b611790612626565b73ffffffffffffffffffffffffffffffffffffffff166117ae611948565b73ffffffffffffffffffffffffffffffffffffffff1614611804576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fb90613f59565b60405180910390fd5b806008908161181391906144d3565b5050565b61181f612626565b73ffffffffffffffffffffffffffffffffffffffff1661183d611948565b73ffffffffffffffffffffffffffffffffffffffff1614611893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188a90613f59565b60405180910390fd5b600b60009054906101000a900460ff16156118e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118da90614683565b60405180910390fd5b6010546118ee610dd1565b826118f991906140cc565b111561193a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119319061414c565b60405180910390fd5b6119448282612c1e565b5050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606002805461198190613d26565b80601f01602080910402602001604051908101604052809291908181526020018280546119ad90613d26565b80156119fa5780601f106119cf576101008083540402835291602001916119fa565b820191906000526020600020905b8154815290600101906020018083116119dd57829003601f168201915b5050505050905090565b600b60009054906101000a900460ff1615611a54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4b90614683565b60405180910390fd5b60008111611a97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8e90614715565b60405180910390fd5b600e54611aa333611545565b82611aae91906140cc565b1115611aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae690614781565b60405180910390fd5b601054611afa610dd1565b82611b0591906140cc565b1115611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d9061414c565b60405180910390fd5b611b4e611948565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611df257600d54601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015158015611be35750600f54600d54601154611be091906140cc565b11155b15611da057601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d54611c3591906147a1565b8111611c84576000341015611c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7690614821565b60405180910390fd5b611d2c565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d54611cd191906147a1565b81611cdc91906147a1565b600c54611ce99190614841565b341015611d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2290614821565b60405180910390fd5b5b8060116000828254611d3e91906140cc565b9250508190555080601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d9491906140cc565b92505081905550611df1565b80600c54611dae9190614841565b341015611df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de790614821565b60405180910390fd5b5b5b611dfc3382612c1e565b50565b611e07612626565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6b906148cf565b60405180910390fd5b8060066000611e81612626565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611f2e612626565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611f7391906135fa565b60405180910390a35050565b611f8a8484846126e0565b611f9684848484612dd6565b611fd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fcc90614961565b60405180910390fd5b50505050565b611fe3612626565b73ffffffffffffffffffffffffffffffffffffffff16612001611948565b73ffffffffffffffffffffffffffffffffffffffff1614612057576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204e90613f59565b60405180910390fd5b80600e8190555050565b606061206c82612619565b6120ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a2906149f3565b60405180910390fd5b60001515600b60019054906101000a900460ff1615150361215857600a80546120d390613d26565b80601f01602080910402602001604051908101604052809291908181526020018280546120ff90613d26565b801561214c5780601f106121215761010080835404028352916020019161214c565b820191906000526020600020905b81548152906001019060200180831161212f57829003601f168201915b505050505090506121b4565b6000612162612f5d565b9050600081511161218257604051806020016040528060008152506121b0565b8061218c84612fef565b60096040516020016121a093929190614ad2565b6040516020818303038152906040525b9150505b919050565b6121c1612626565b73ffffffffffffffffffffffffffffffffffffffff166121df611948565b73ffffffffffffffffffffffffffffffffffffffff1614612235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222c90613f59565b60405180910390fd5b80600f8190555050565b60105481565b61224d612626565b73ffffffffffffffffffffffffffffffffffffffff1661226b611948565b73ffffffffffffffffffffffffffffffffffffffff16146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b890613f59565b60405180910390fd5b80600d8190555050565b6122d3612626565b73ffffffffffffffffffffffffffffffffffffffff166122f1611948565b73ffffffffffffffffffffffffffffffffffffffff1614612347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233e90613f59565b60405180910390fd5b80600b60016101000a81548160ff02191690831515021790555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612400612626565b73ffffffffffffffffffffffffffffffffffffffff1661241e611948565b73ffffffffffffffffffffffffffffffffffffffff1614612474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246b90613f59565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036124e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124da90614b75565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c5481565b600f5481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000805482109050919050565b600033905090565b826005600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b60006126eb82612c3c565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff16612712612626565b73ffffffffffffffffffffffffffffffffffffffff16148061276e5750612737612626565b73ffffffffffffffffffffffffffffffffffffffff1661275684610b9b565b73ffffffffffffffffffffffffffffffffffffffff16145b8061278a57506127898260000151612784612626565b612364565b5b9050806127cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c390614c07565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff161461283e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283590614c99565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036128ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a490614d2b565b60405180910390fd5b6128ba858585600161314f565b6128ca600084846000015161262e565b6001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550836003600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600085815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506000600184019050600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603612bae57612b0d81612619565b15612bad5782600001516003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082602001516003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b5b50828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612c178585856001613155565b5050505050565b612c3882826040518060200160405280600081525061315b565b5050565b612c4461350c565b612c4d82612619565b612c8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c8390614dbd565b60405180910390fd5b60008290505b60008110612d95576000600360008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614612d86578092505050612dd1565b50808060019003915050612c92565b506040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dc890614e4f565b60405180910390fd5b919050565b6000612df78473ffffffffffffffffffffffffffffffffffffffff1661316d565b15612f50578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e20612626565b8786866040518563ffffffff1660e01b8152600401612e429493929190614ec4565b6020604051808303816000875af1925050508015612e7e57506040513d601f19601f82011682018060405250810190612e7b9190614f25565b60015b612f00573d8060008114612eae576040519150601f19603f3d011682016040523d82523d6000602084013e612eb3565b606091505b506000815103612ef8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eef90614961565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612f55565b600190505b949350505050565b606060088054612f6c90613d26565b80601f0160208091040260200160405190810160405280929190818152602001828054612f9890613d26565b8015612fe55780601f10612fba57610100808354040283529160200191612fe5565b820191906000526020600020905b815481529060010190602001808311612fc857829003601f168201915b5050505050905090565b606060008203613036576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061314a565b600082905060005b600082146130685780806130519061424d565b915050600a826130619190614f81565b915061303e565b60008167ffffffffffffffff811115613084576130836139df565b5b6040519080825280601f01601f1916602001820160405280156130b65781602001600182028036833780820191505090505b5090505b60008514613143576001826130cf91906147a1565b9150600a856130de9190614fb2565b60306130ea91906140cc565b60f81b818381518110613100576130ff61421e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561313c9190614f81565b94506130ba565b8093505050505b919050565b50505050565b50505050565b6131688383836001613190565b505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600080549050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603613205576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131fc90615055565b60405180910390fd5b60008403613248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323f906150e7565b60405180910390fd5b613255600086838761314f565b83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555083600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550846003600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426003600083815260200190815260200160002060000160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550600081905060005b858110156134ef57818773ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a483156134da5761349a6000888488612dd6565b6134d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134d090614961565b60405180910390fd5b5b81806001019250508080600101915050613423565b5080600081905550506135056000868387613155565b5050505050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61358f8161355a565b811461359a57600080fd5b50565b6000813590506135ac81613586565b92915050565b6000602082840312156135c8576135c7613550565b5b60006135d68482850161359d565b91505092915050565b60008115159050919050565b6135f4816135df565b82525050565b600060208201905061360f60008301846135eb565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561364f578082015181840152602081019050613634565b60008484015250505050565b6000601f19601f8301169050919050565b600061367782613615565b6136818185613620565b9350613691818560208601613631565b61369a8161365b565b840191505092915050565b600060208201905081810360008301526136bf818461366c565b905092915050565b6000819050919050565b6136da816136c7565b81146136e557600080fd5b50565b6000813590506136f7816136d1565b92915050565b60006020828403121561371357613712613550565b5b6000613721848285016136e8565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006137558261372a565b9050919050565b6137658161374a565b82525050565b6000602082019050613780600083018461375c565b92915050565b61378f8161374a565b811461379a57600080fd5b50565b6000813590506137ac81613786565b92915050565b600080604083850312156137c9576137c8613550565b5b60006137d78582860161379d565b92505060206137e8858286016136e8565b9150509250929050565b6137fb816135df565b811461380657600080fd5b50565b600081359050613818816137f2565b92915050565b60006020828403121561383457613833613550565b5b600061384284828501613809565b91505092915050565b613854816136c7565b82525050565b600060208201905061386f600083018461384b565b92915050565b60008060006060848603121561388e5761388d613550565b5b600061389c8682870161379d565b93505060206138ad8682870161379d565b92505060406138be868287016136e8565b9150509250925092565b6000602082840312156138de576138dd613550565b5b60006138ec8482850161379d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61392a816136c7565b82525050565b600061393c8383613921565b60208301905092915050565b6000602082019050919050565b6000613960826138f5565b61396a8185613900565b935061397583613911565b8060005b838110156139a657815161398d8882613930565b975061399883613948565b925050600181019050613979565b5085935050505092915050565b600060208201905081810360008301526139cd8184613955565b905092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613a178261365b565b810181811067ffffffffffffffff82111715613a3657613a356139df565b5b80604052505050565b6000613a49613546565b9050613a558282613a0e565b919050565b600067ffffffffffffffff821115613a7557613a746139df565b5b613a7e8261365b565b9050602081019050919050565b82818337600083830152505050565b6000613aad613aa884613a5a565b613a3f565b905082815260208101848484011115613ac957613ac86139da565b5b613ad4848285613a8b565b509392505050565b600082601f830112613af157613af06139d5565b5b8135613b01848260208601613a9a565b91505092915050565b600060208284031215613b2057613b1f613550565b5b600082013567ffffffffffffffff811115613b3e57613b3d613555565b5b613b4a84828501613adc565b91505092915050565b60008060408385031215613b6a57613b69613550565b5b6000613b788582860161379d565b9250506020613b8985828601613809565b9150509250929050565b600067ffffffffffffffff821115613bae57613bad6139df565b5b613bb78261365b565b9050602081019050919050565b6000613bd7613bd284613b93565b613a3f565b905082815260208101848484011115613bf357613bf26139da565b5b613bfe848285613a8b565b509392505050565b600082601f830112613c1b57613c1a6139d5565b5b8135613c2b848260208601613bc4565b91505092915050565b60008060008060808587031215613c4e57613c4d613550565b5b6000613c5c8782880161379d565b9450506020613c6d8782880161379d565b9350506040613c7e878288016136e8565b925050606085013567ffffffffffffffff811115613c9f57613c9e613555565b5b613cab87828801613c06565b91505092959194509250565b60008060408385031215613cce57613ccd613550565b5b6000613cdc8582860161379d565b9250506020613ced8582860161379d565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613d3e57607f821691505b602082108103613d5157613d50613cf7565b5b50919050565b7f455243373231413a20617070726f76656420717565727920666f72206e6f6e6560008201527f78697374656e7420746f6b656e00000000000000000000000000000000000000602082015250565b6000613db3602d83613620565b9150613dbe82613d57565b604082019050919050565b60006020820190508181036000830152613de281613da6565b9050919050565b7f455243373231413a20617070726f76616c20746f2063757272656e74206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e45602283613620565b9150613e5082613de9565b604082019050919050565b60006020820190508181036000830152613e7481613e38565b9050919050565b7f455243373231413a20617070726f76652063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f76656420666f7220616c6c00000000000000602082015250565b6000613ed7603983613620565b9150613ee282613e7b565b604082019050919050565b60006020820190508181036000830152613f0681613eca565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613f43602083613620565b9150613f4e82613f0d565b602082019050919050565b60006020820190508181036000830152613f7281613f36565b9050919050565b7f455243373231413a206f776e657220696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b6000613fd5602283613620565b9150613fe082613f79565b604082019050919050565b6000602082019050818103600083015261400481613fc8565b9050919050565b7f455243373231413a20756e61626c6520746f2067657420746f6b656e206f662060008201527f6f776e657220627920696e646578000000000000000000000000000000000000602082015250565b6000614067602e83613620565b91506140728261400b565b604082019050919050565b600060208201905081810360008301526140968161405a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006140d7826136c7565b91506140e2836136c7565b92508282019050808211156140fa576140f961409d565b5b92915050565b7f536f6c64206f7574000000000000000000000000000000000000000000000000600082015250565b6000614136600883613620565b915061414182614100565b602082019050919050565b6000602082019050818103600083015261416581614129565b9050919050565b600081905092915050565b50565b600061418760008361416c565b915061419282614177565b600082019050919050565b60006141a88261417a565b9150819050919050565b7f5472616e73666572206661696c65642e00000000000000000000000000000000600082015250565b60006141e8601083613620565b91506141f3826141b2565b602082019050919050565b60006020820190508181036000830152614217816141db565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614258826136c7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361428a5761428961409d565b5b600182019050919050565b7f455243373231413a20676c6f62616c20696e646578206f7574206f6620626f7560008201527f6e64730000000000000000000000000000000000000000000000000000000000602082015250565b60006142f1602383613620565b91506142fc82614295565b604082019050919050565b60006020820190508181036000830152614320816142e4565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026143897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261434c565b614393868361434c565b95508019841693508086168417925050509392505050565b6000819050919050565b60006143d06143cb6143c6846136c7565b6143ab565b6136c7565b9050919050565b6000819050919050565b6143ea836143b5565b6143fe6143f6826143d7565b848454614359565b825550505050565b600090565b614413614406565b61441e8184846143e1565b505050565b5b818110156144425761443760008261440b565b600181019050614424565b5050565b601f8211156144875761445881614327565b6144618461433c565b81016020851015614470578190505b61448461447c8561433c565b830182614423565b50505b505050565b600082821c905092915050565b60006144aa6000198460080261448c565b1980831691505092915050565b60006144c38383614499565b9150826002028217905092915050565b6144dc82613615565b67ffffffffffffffff8111156144f5576144f46139df565b5b6144ff8254613d26565b61450a828285614446565b600060209050601f83116001811461453d576000841561452b578287015190505b61453585826144b7565b86555061459d565b601f19841661454b86614327565b60005b828110156145735784890151825560018201915060208501945060208101905061454e565b86831015614590578489015161458c601f891682614499565b8355505b6001600288020188555050505b505050505050565b7f455243373231413a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b6000614601602b83613620565b915061460c826145a5565b604082019050919050565b60006020820190508181036000830152614630816145f4565b9050919050565b7f54686520636f6e74726163742069732070617573656421000000000000000000600082015250565b600061466d601783613620565b915061467882614637565b602082019050919050565b6000602082019050818103600083015261469c81614660565b9050919050565b7f4d696e696d756d2031204e46542068617320746f206265206d696e746564207060008201527f6572207472616e73616374696f6e000000000000000000000000000000000000602082015250565b60006146ff602e83613620565b915061470a826146a3565b604082019050919050565b6000602082019050818103600083015261472e816146f2565b9050919050565b7f4e6f206d6f726521000000000000000000000000000000000000000000000000600082015250565b600061476b600883613620565b915061477682614735565b602082019050919050565b6000602082019050818103600083015261479a8161475e565b9050919050565b60006147ac826136c7565b91506147b7836136c7565b92508282039050818111156147cf576147ce61409d565b5b92915050565b7f506c656173652073656e642074686520657861637420616d6f756e742e000000600082015250565b600061480b601d83613620565b9150614816826147d5565b602082019050919050565b6000602082019050818103600083015261483a816147fe565b9050919050565b600061484c826136c7565b9150614857836136c7565b9250828202614865816136c7565b9150828204841483151761487c5761487b61409d565b5b5092915050565b7f455243373231413a20617070726f766520746f2063616c6c6572000000000000600082015250565b60006148b9601a83613620565b91506148c482614883565b602082019050919050565b600060208201905081810360008301526148e8816148ac565b9050919050565b7f455243373231413a207472616e7366657220746f206e6f6e204552433732315260008201527f6563656976657220696d706c656d656e74657200000000000000000000000000602082015250565b600061494b603383613620565b9150614956826148ef565b604082019050919050565b6000602082019050818103600083015261497a8161493e565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b60006149dd602f83613620565b91506149e882614981565b604082019050919050565b60006020820190508181036000830152614a0c816149d0565b9050919050565b600081905092915050565b6000614a2982613615565b614a338185614a13565b9350614a43818560208601613631565b80840191505092915050565b60008154614a5c81613d26565b614a668186614a13565b94506001821660008114614a815760018114614a9657614ac9565b60ff1983168652811515820286019350614ac9565b614a9f85614327565b60005b83811015614ac157815481890152600182019150602081019050614aa2565b838801955050505b50505092915050565b6000614ade8286614a1e565b9150614aea8285614a1e565b9150614af68284614a4f565b9150819050949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614b5f602683613620565b9150614b6a82614b03565b604082019050919050565b60006020820190508181036000830152614b8e81614b52565b9050919050565b7f455243373231413a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b6000614bf1603283613620565b9150614bfc82614b95565b604082019050919050565b60006020820190508181036000830152614c2081614be4565b9050919050565b7f455243373231413a207472616e736665722066726f6d20696e636f727265637460008201527f206f776e65720000000000000000000000000000000000000000000000000000602082015250565b6000614c83602683613620565b9150614c8e82614c27565b604082019050919050565b60006020820190508181036000830152614cb281614c76565b9050919050565b7f455243373231413a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614d15602583613620565b9150614d2082614cb9565b604082019050919050565b60006020820190508181036000830152614d4481614d08565b9050919050565b7f455243373231413a206f776e657220717565727920666f72206e6f6e6578697360008201527f74656e7420746f6b656e00000000000000000000000000000000000000000000602082015250565b6000614da7602a83613620565b9150614db282614d4b565b604082019050919050565b60006020820190508181036000830152614dd681614d9a565b9050919050565b7f455243373231413a20756e61626c6520746f2064657465726d696e652074686560008201527f206f776e6572206f6620746f6b656e0000000000000000000000000000000000602082015250565b6000614e39602f83613620565b9150614e4482614ddd565b604082019050919050565b60006020820190508181036000830152614e6881614e2c565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614e9682614e6f565b614ea08185614e7a565b9350614eb0818560208601613631565b614eb98161365b565b840191505092915050565b6000608082019050614ed9600083018761375c565b614ee6602083018661375c565b614ef3604083018561384b565b8181036060830152614f058184614e8b565b905095945050505050565b600081519050614f1f81613586565b92915050565b600060208284031215614f3b57614f3a613550565b5b6000614f4984828501614f10565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614f8c826136c7565b9150614f97836136c7565b925082614fa757614fa6614f52565b5b828204905092915050565b6000614fbd826136c7565b9150614fc8836136c7565b925082614fd857614fd7614f52565b5b828206905092915050565b7f455243373231413a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b600061503f602183613620565b915061504a82614fe3565b604082019050919050565b6000602082019050818103600083015261506e81615032565b9050919050565b7f455243373231413a207175616e74697479206d7573742062652067726561746560008201527f72207468616e2030000000000000000000000000000000000000000000000000602082015250565b60006150d1602883613620565b91506150dc82615075565b604082019050919050565b60006020820190508181036000830152615100816150c4565b905091905056fea2646970667358221220bfbb598fd35e40da694ec5d7a591eeeeeaf2cd9a30153b2f52e0ff305fdb143f64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: No
Ghostchildape.sol 2208 lines
// SPDX-License-Identifier: MIT
// File 1: Address.sol
// OpenZeppelin Contracts v4.4.1 (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);
}
}
}
}
// FILE 2: 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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File 3: Strings.sol
// 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);
}
}
// File 4: 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() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), 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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File 5: 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 6: 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 7: 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 returns (string memory);
}
// File 8: 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 9: ERC721.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
/**
* @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
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
if (to.isContract()) {
revert("Token transfer to contract address is not allowed.");
} else {
_approve(to, tokenId);
}
// _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 {}
}
// File 10: 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 11: ERC721Enumerable.sol
pragma solidity ^0.8.0;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC721)
returns (bool)
{
return
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721.balanceOf(owner),
"ERC721Enumerable: owner index out of bounds"
);
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index)
public
view
virtual
override
returns (uint256)
{
require(
index < ERC721Enumerable.totalSupply(),
"ERC721Enumerable: global index out of bounds"
);
return _allTokens[index];
}
/**
* @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` cannot be the zero address.
* - `to` cannot be the zero address.
*
* 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 override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId)
private
{
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// File 12: 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 13: ERC721A.sol
pragma solidity ^0.8.0;
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 = 1;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) internal _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual 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;
address currOwnershipAddr;
// Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar.
unchecked {
for (uint256 i; 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);
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721A: owner query for nonexistent token");
unchecked {
for (uint256 curr = tokenId; curr >= 0; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
}
revert("ERC721A: unable...
// [truncated — 67375 bytes total]
Read Contract
CLAIMED 0x71a34298 → uint256
FREE_MINTED 0x5e1a2636 → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxFree 0x485a68a3 → uint256
maxSupply 0xd5abeb01 → uint256
maxTx 0x7437681e → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
rescure 0xf53a7360 → uint256
revealed 0x51830227 → bool
salePrice 0xf51f96dd → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
airdrop 0x8ba4cc3c
address _to
uint256 _quantity
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _quantity
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
setHiddenMetadataUri 0x4fdd43cb
string _hiddenMetadataUri
setMaxFree 0xd755bf99
uint256 _maxFree
setMaxSupply 0x6f8b44b0
uint256 _maxSupply
setMaxTx 0xbc337182
uint256 _maxTx
setPaused 0x16c38b3c
bool _state
setRescure 0xd26be2eb
uint256 _rescure
setRevealed 0xe0a80853
bool _state
setSalePrice 0x1919fed7
uint256 _newPrice
setUriPrefix 0x7ec4a659
string _uriPrefix
teamMint 0x2fbba115
uint256 _quantity
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address