Address Contract Partially Verified
Address
0x39239b6040207A4D3d657aD00554669A992cA451
Balance
0 ETH
Nonce
1
Code Size
20512 bytes
Creator
0xd4D19c16...B7eE at tx 0x20a0a118...882bd4
Indexed Transactions
0
Contract Bytecode
20512 bytes
0x60806040526004361061023b5760003560e01c8063853828b61161012e578063b95f8b5f116100ab578063de4b32621161006f578063de4b32621461087c578063e985e9c5146108a5578063f127394c146108e2578063f2fde38b1461090d578063fe4ca847146109365761023b565b8063b95f8b5f14610795578063c25f7b04146107be578063c7876ea4146107e9578063c87b56dd14610814578063d019dee2146108515761023b565b8063a22cb465116100f2578063a22cb465146106d5578063b02636fd146106fe578063b39d900914610727578063b56d2f6714610743578063b88d4fde1461076c5761023b565b8063853828b61461060f57806386f0f7ae146106195780638da5cb5b146106565780638e825be01461068157806395d89b41146106aa5761023b565b80632884c62a116101bc57806355f804b31161018057806355f804b3146105045780636352211e1461052d5780636e1bd3231461056a57806370a08231146105955780638462151c146105d25761023b565b80632884c62a1461041c5780632f745c591461044557806340c10f191461048257806342842e0e1461049e5780634f6ccce7146104c75761023b565b806315446b091161020357806315446b091461033757806318160ddd14610362578063196694e91461038d57806323b872dd146103b657806326a49e37146103df5761023b565b806301ffc9a71461024057806306fdde031461027d578063081812fc146102a8578063095ea7b3146102e557806309acc2cb1461030e575b600080fd5b34801561024c57600080fd5b5061026760048036038101906102629190613919565b610961565b604051610274919061406e565b60405180910390f35b34801561028957600080fd5b506102926109db565b60405161029f9190614089565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca91906139bc565b610a6d565b6040516102dc9190613fe5565b60405180910390f35b3480156102f157600080fd5b5061030c600480360381019061030791906138ac565b610af2565b005b34801561031a57600080fd5b50610335600480360381019061033091906139bc565b610c0a565b005b34801561034357600080fd5b5061034c610c90565b60405161035991906144cb565b60405180910390f35b34801561036e57600080fd5b50610377610c96565b60405161038491906144cb565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af9190613729565b610ca3565b005b3480156103c257600080fd5b506103dd60048036038101906103d89190613796565b610d63565b005b3480156103eb57600080fd5b50610406600480360381019061040191906139bc565b610dc3565b60405161041391906144cb565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e91906139bc565b610dfb565b005b34801561045157600080fd5b5061046c600480360381019061046791906138ac565b61103b565b60405161047991906144cb565b60405180910390f35b61049c600480360381019061049791906138ac565b6110e0565b005b3480156104aa57600080fd5b506104c560048036038101906104c09190613796565b611368565b005b3480156104d357600080fd5b506104ee60048036038101906104e991906139bc565b611388565b6040516104fb91906144cb565b60405180910390f35b34801561051057600080fd5b5061052b60048036038101906105269190613973565b6113f9565b005b34801561053957600080fd5b50610554600480360381019061054f91906139bc565b61148f565b6040516105619190613fe5565b60405180910390f35b34801561057657600080fd5b5061057f611541565b60405161058c91906144cb565b60405180910390f35b3480156105a157600080fd5b506105bc60048036038101906105b791906136fc565b611547565b6040516105c991906144cb565b60405180910390f35b3480156105de57600080fd5b506105f960048036038101906105f491906136fc565b6115ff565b604051610606919061404c565b60405180910390f35b6106176116ad565b005b34801561062557600080fd5b50610640600480360381019061063b91906136fc565b611733565b60405161064d91906144cb565b60405180910390f35b34801561066257600080fd5b5061066b61177c565b6040516106789190613fe5565b60405180910390f35b34801561068d57600080fd5b506106a860048036038101906106a391906138ac565b6117a6565b005b3480156106b657600080fd5b506106bf611943565b6040516106cc9190614089565b60405180910390f35b3480156106e157600080fd5b506106fc60048036038101906106f7919061386c565b6119d5565b005b34801561070a57600080fd5b50610725600480360381019061072091906138ec565b611b56565b005b610741600480360381019061073c91906138ac565b611bef565b005b34801561074f57600080fd5b5061076a600480360381019061076591906138ec565b611e49565b005b34801561077857600080fd5b50610793600480360381019061078e91906137e9565b611ee2565b005b3480156107a157600080fd5b506107bc60048036038101906107b791906139bc565b611f44565b005b3480156107ca57600080fd5b506107d3611fca565b6040516107e0919061406e565b60405180910390f35b3480156107f557600080fd5b506107fe611fdd565b60405161080b91906144cb565b60405180910390f35b34801561082057600080fd5b5061083b600480360381019061083691906139bc565b611fe3565b6040516108489190614089565b60405180910390f35b34801561085d57600080fd5b5061086661208a565b60405161087391906144cb565b60405180910390f35b34801561088857600080fd5b506108a3600480360381019061089e91906139bc565b612090565b005b3480156108b157600080fd5b506108cc60048036038101906108c79190613756565b612116565b6040516108d9919061406e565b60405180910390f35b3480156108ee57600080fd5b506108f76121aa565b60405161090491906144cb565b60405180910390f35b34801561091957600080fd5b50610934600480360381019061092f91906136fc565b6121b0565b005b34801561094257600080fd5b5061094b61235c565b604051610958919061406e565b60405180910390f35b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109d457506109d38261236f565b5b9050919050565b6060600080546109ea906147c6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a16906147c6565b8015610a635780601f10610a3857610100808354040283529160200191610a63565b820191906000526020600020905b815481529060010190602001808311610a4657829003601f168201915b5050505050905090565b6000610a7882612451565b610ab7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aae9061424b565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610afd8261148f565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b659061434b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b8d6124bd565b73ffffffffffffffffffffffffffffffffffffffff161480610bbc5750610bbb81610bb66124bd565b612116565b5b610bfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf29061416b565b60405180910390fd5b610c0583836124c5565b505050565b610c126124bd565b73ffffffffffffffffffffffffffffffffffffffff16610c3061177c565b73ffffffffffffffffffffffffffffffffffffffff1614610c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7d9061430b565b60405180910390fd5b80600d8190555050565b60145481565b6000600880549050905090565b610cab6124bd565b73ffffffffffffffffffffffffffffffffffffffff16610cc961177c565b73ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d169061430b565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610d74610d6e6124bd565b8261257e565b610db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610daa9061426b565b60405180910390fd5b610dbe83838361265c565b505050565b600060fa6096610dd391906145e9565b6012541015610de55760009050610df6565b81601354610df39190614670565b90505b919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e635750601660009054906101000a900460ff165b610ea2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e999061412b565b60405180910390fd5b600d546012541115610ee9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee0906143cb565b60405180910390fd5b600d5481601254610efa91906145e9565b1115610f3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f32906142eb565b60405180910390fd5b610f4433611733565b600010610f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7d906141cb565b60405180910390fd5b60005b81811015610fc857610f9d336012546128b8565b60126000815480929190610fb090614829565b91905055508080610fc090614829565b915050610f89565b5080601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461101891906146ca565b9250508190555080600f600082825461103191906146ca565b9250508190555050565b600061104683611547565b8210611087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107e9061410b565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111485750601660009054906101000a900460ff165b611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e9061412b565b60405180910390fd5b600d54600f5460125461119a91906145e9565b11156111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906143cb565b60405180910390fd5b600d5481600f546012546111ef91906145e9565b6111f991906145e9565b111561123a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611231906142eb565b60405180910390fd5b601481111561127e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611275906143ab565b60405180910390fd5b61128781610dc3565b341015806112e25750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611321576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113189061438b565b60405180910390fd5b60005b8181101561136357611338836012546128b8565b6012600081548092919061134b90614829565b9190505550808061135b90614829565b915050611324565b505050565b61138383838360405180602001604052806000815250611ee2565b505050565b6000611392610c96565b82106113d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ca906143eb565b60405180910390fd5b600882815481106113e7576113e661495f565b5b90600052602060002001549050919050565b6114016124bd565b73ffffffffffffffffffffffffffffffffffffffff1661141f61177c565b73ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c9061430b565b60405180910390fd5b806015908051906020019061148b9291906134fb565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152f906140ab565b60405180910390fd5b80915050919050565b600d5481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115af9061446b565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600061160c83611547565b905060008167ffffffffffffffff81111561162a5761162961498e565b5b6040519080825280602002602001820160405280156116585781602001602082028036833780820191505090505b50905060005b828110156116a257611670858261103b565b8282815181106116835761168261495f565b5b602002602001018181525050808061169a90614829565b91505061165e565b508092505050919050565b6116b56124bd565b73ffffffffffffffffffffffffffffffffffffffff166116d361177c565b73ffffffffffffffffffffffffffffffffffffffff1614611729576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117209061430b565b60405180910390fd5b6117316128d6565b565b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6117ae6124bd565b73ffffffffffffffffffffffffffffffffffffffff166117cc61177c565b73ffffffffffffffffffffffffffffffffffffffff1614611822576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118199061430b565b60405180910390fd5b609660115410611867576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185e9061444b565b60405180910390fd5b60968160115461187791906145e9565b11156118b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118af9061428b565b60405180910390fd5b60148111156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f3906143ab565b60405180910390fd5b60005b8181101561193e57611913836011546128b8565b6011600081548092919061192690614829565b9190505550808061193690614829565b9150506118ff565b505050565b606060018054611952906147c6565b80601f016020809104026020016040519081016040528092919081815260200182805461197e906147c6565b80156119cb5780601f106119a0576101008083540402835291602001916119cb565b820191906000526020600020905b8154815290600101906020018083116119ae57829003601f168201915b5050505050905090565b6119dd6124bd565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a42906141ab565b60405180910390fd5b8060056000611a586124bd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611b056124bd565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611b4a919061406e565b60405180910390a35050565b611b5e6124bd565b73ffffffffffffffffffffffffffffffffffffffff16611b7c61177c565b73ffffffffffffffffffffffffffffffffffffffff1614611bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc99061430b565b60405180910390fd5b80601660006101000a81548160ff02191690831515021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611c575750601660019054906101000a900460ff165b611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8d9061422b565b60405180910390fd5b600e54600f5410611cdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd39061418b565b60405180910390fd5b600e5481600f54611ced91906145e9565b1115611d2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d259061442b565b60405180910390fd5b80601454611d3c9190614670565b34101580611d975750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd9061440b565b60405180910390fd5b80601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e2591906145e9565b9250508190555080600f6000828254611e3e91906145e9565b925050819055505050565b611e516124bd565b73ffffffffffffffffffffffffffffffffffffffff16611e6f61177c565b73ffffffffffffffffffffffffffffffffffffffff1614611ec5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebc9061430b565b60405180910390fd5b80601660016101000a81548160ff02191690831515021790555050565b611ef3611eed6124bd565b8361257e565b611f32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f299061448b565b60405180910390fd5b611f3e84848484612a50565b50505050565b611f4c6124bd565b73ffffffffffffffffffffffffffffffffffffffff16611f6a61177c565b73ffffffffffffffffffffffffffffffffffffffff1614611fc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb79061430b565b60405180910390fd5b8060148190555050565b601660019054906101000a900460ff1681565b60135481565b6060611fee82612451565b61202d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120249061432b565b60405180910390fd5b6000612037612aac565b905060008151116120575760405180602001604052806000815250612082565b8061206184612b3e565b604051602001612072929190613fc1565b6040516020818303038152906040525b915050919050565b600f5481565b6120986124bd565b73ffffffffffffffffffffffffffffffffffffffff166120b661177c565b73ffffffffffffffffffffffffffffffffffffffff161461210c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121039061430b565b60405180910390fd5b8060138190555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60125481565b6121b86124bd565b73ffffffffffffffffffffffffffffffffffffffff166121d661177c565b73ffffffffffffffffffffffffffffffffffffffff161461222c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122239061430b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561229c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612293906140cb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601660009054906101000a900460ff1681565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061243a57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061244a575061244982612c9f565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166125388361148f565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061258982612451565b6125c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bf9061436b565b60405180910390fd5b60006125d38361148f565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061264257508373ffffffffffffffffffffffffffffffffffffffff1661262a84610a6d565b73ffffffffffffffffffffffffffffffffffffffff16145b8061265357506126528185612116565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661267c8261148f565b73ffffffffffffffffffffffffffffffffffffffff16146126d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126c99061420b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612742576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612739906144ab565b60405180910390fd5b61274d838383612d09565b6127586000826124c5565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127a891906146ca565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127ff91906145e9565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6128d2828260405180602001604052806000815250612e1d565b5050565b60006064600e476128e79190614670565b6128f1919061463f565b905060006064601e476129049190614670565b61290e919061463f565b9050600082824761291f91906146ca565b61292991906146ca565b9050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015612993573d6000803e3d6000fd5b50600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156129fc573d6000803e3d6000fd5b50612a056124bd565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612a4a573d6000803e3d6000fd5b50505050565b612a5b84848461265c565b612a6784848484612e78565b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a9d9061414b565b60405180910390fd5b50505050565b606060158054612abb906147c6565b80601f0160208091040260200160405190810160405280929190818152602001828054612ae7906147c6565b8015612b345780601f10612b0957610100808354040283529160200191612b34565b820191906000526020600020905b815481529060010190602001808311612b1757829003601f168201915b5050505050905090565b60606000821415612b86576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612c9a565b600082905060005b60008214612bb8578080612ba190614829565b915050600a82612bb1919061463f565b9150612b8e565b60008167ffffffffffffffff811115612bd457612bd361498e565b5b6040519080825280601f01601f191660200182016040528015612c065781602001600182028036833780820191505090505b5090505b60008514612c9357600182612c1f91906146ca565b9150600a85612c2e9190614872565b6030612c3a91906145e9565b60f81b818381518110612c5057612c4f61495f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612c8c919061463f565b9450612c0a565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612d1483838361300f565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612d5757612d5281613014565b612d96565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612d9557612d94838261305d565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612dd957612dd4816131ca565b612e18565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612e1757612e16828261329b565b5b5b505050565b612e27838361331a565b612e346000848484612e78565b612e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6a906140eb565b60405180910390fd5b505050565b6000612e998473ffffffffffffffffffffffffffffffffffffffff166134e8565b15613002578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612ec26124bd565b8786866040518563ffffffff1660e01b8152600401612ee49493929190614000565b602060405180830381600087803b158015612efe57600080fd5b505af1925050508015612f2f57506040513d601f19601f82011682018060405250810190612f2c9190613946565b60015b612fb2573d8060008114612f5f576040519150601f19603f3d011682016040523d82523d6000602084013e612f64565b606091505b50600081511415612faa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fa1906142ab565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613007565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161306a84611547565b61307491906146ca565b9050600060076000848152602001908152602001600020549050818114613159576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506131de91906146ca565b905060006009600084815260200190815260200160002054905060006008838154811061320e5761320d61495f565b5b9060005260206000200154905080600883815481106132305761322f61495f565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061327f5761327e614930565b5b6001900381819060005260206000200160009055905550505050565b60006132a683611547565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561338a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613381906142cb565b60405180910390fd5b61339381612451565b156133d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133ca906141eb565b60405180910390fd5b6133df60008383612d09565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461342f91906145e9565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b828054613507906147c6565b90600052602060002090601f0160209004810192826135295760008555613570565b82601f1061354257805160ff1916838001178555613570565b82800160010185558215613570579182015b8281111561356f578251825591602001919060010190613554565b5b50905061357d9190613581565b5090565b5b8082111561359a576000816000905550600101613582565b5090565b60006135b16135ac8461450b565b6144e6565b9050828152602081018484840111156135cd576135cc6149c2565b5b6135d8848285614784565b509392505050565b60006135f36135ee8461453c565b6144e6565b90508281526020810184848401111561360f5761360e6149c2565b5b61361a848285614784565b509392505050565b60008135905061363181614f77565b92915050565b60008135905061364681614f8e565b92915050565b60008135905061365b81614fa5565b92915050565b60008135905061367081614fbc565b92915050565b60008151905061368581614fbc565b92915050565b600082601f8301126136a05761369f6149bd565b5b81356136b084826020860161359e565b91505092915050565b600082601f8301126136ce576136cd6149bd565b5b81356136de8482602086016135e0565b91505092915050565b6000813590506136f681614fd3565b92915050565b600060208284031215613712576137116149cc565b5b600061372084828501613622565b91505092915050565b60006020828403121561373f5761373e6149cc565b5b600061374d84828501613637565b91505092915050565b6000806040838503121561376d5761376c6149cc565b5b600061377b85828601613622565b925050602061378c85828601613622565b9150509250929050565b6000806000606084860312156137af576137ae6149cc565b5b60006137bd86828701613622565b93505060206137ce86828701613622565b92505060406137df868287016136e7565b9150509250925092565b60008060008060808587031215613803576138026149cc565b5b600061381187828801613622565b945050602061382287828801613622565b9350506040613833878288016136e7565b925050606085013567ffffffffffffffff811115613854576138536149c7565b5b6138608782880161368b565b91505092959194509250565b60008060408385031215613883576138826149cc565b5b600061389185828601613622565b92505060206138a28582860161364c565b9150509250929050565b600080604083850312156138c3576138c26149cc565b5b60006138d185828601613622565b92505060206138e2858286016136e7565b9150509250929050565b600060208284031215613902576139016149cc565b5b60006139108482850161364c565b91505092915050565b60006020828403121561392f5761392e6149cc565b5b600061393d84828501613661565b91505092915050565b60006020828403121561395c5761395b6149cc565b5b600061396a84828501613676565b91505092915050565b600060208284031215613989576139886149cc565b5b600082013567ffffffffffffffff8111156139a7576139a66149c7565b5b6139b3848285016136b9565b91505092915050565b6000602082840312156139d2576139d16149cc565b5b60006139e0848285016136e7565b91505092915050565b60006139f58383613fa3565b60208301905092915050565b613a0a816146fe565b82525050565b6000613a1b8261457d565b613a2581856145ab565b9350613a308361456d565b8060005b83811015613a61578151613a4888826139e9565b9750613a538361459e565b925050600181019050613a34565b5085935050505092915050565b613a7781614722565b82525050565b6000613a8882614588565b613a9281856145bc565b9350613aa2818560208601614793565b613aab816149d1565b840191505092915050565b6000613ac182614593565b613acb81856145cd565b9350613adb818560208601614793565b613ae4816149d1565b840191505092915050565b6000613afa82614593565b613b0481856145de565b9350613b14818560208601614793565b80840191505092915050565b6000613b2d6003836145cd565b9150613b38826149e2565b602082019050919050565b6000613b506003836145cd565b9150613b5b82614a0b565b602082019050919050565b6000613b736003836145cd565b9150613b7e82614a34565b602082019050919050565b6000613b96602b836145cd565b9150613ba182614a5d565b604082019050919050565b6000613bb9600f836145cd565b9150613bc482614aac565b602082019050919050565b6000613bdc6003836145cd565b9150613be782614ad5565b602082019050919050565b6000613bff6003836145cd565b9150613c0a82614afe565b602082019050919050565b6000613c226011836145cd565b9150613c2d82614b27565b602082019050919050565b6000613c456003836145cd565b9150613c5082614b50565b602082019050919050565b6000613c68600e836145cd565b9150613c7382614b79565b602082019050919050565b6000613c8b6003836145cd565b9150613c9682614ba2565b602082019050919050565b6000613cae6003836145cd565b9150613cb982614bcb565b602082019050919050565b6000613cd16014836145cd565b9150613cdc82614bf4565b602082019050919050565b6000613cf46003836145cd565b9150613cff82614c1d565b602082019050919050565b6000613d176003836145cd565b9150613d2282614c46565b602082019050919050565b6000613d3a6002836145cd565b9150613d4582614c6f565b602082019050919050565b6000613d5d6003836145cd565b9150613d6882614c98565b602082019050919050565b6000613d806003836145cd565b9150613d8b82614cc1565b602082019050919050565b6000613da3600d836145cd565b9150613dae82614cea565b602082019050919050565b6000613dc66003836145cd565b9150613dd182614d13565b602082019050919050565b6000613de96003836145cd565b9150613df482614d3c565b602082019050919050565b6000613e0c6003836145cd565b9150613e1782614d65565b602082019050919050565b6000613e2f6003836145cd565b9150613e3a82614d8e565b602082019050919050565b6000613e526011836145cd565b9150613e5d82614db7565b602082019050919050565b6000613e75600a836145cd565b9150613e8082614de0565b602082019050919050565b6000613e986008836145cd565b9150613ea382614e09565b602082019050919050565b6000613ebb602c836145cd565b9150613ec682614e32565b604082019050919050565b6000613ede6012836145cd565b9150613ee982614e81565b602082019050919050565b6000613f016016836145cd565b9150613f0c82614eaa565b602082019050919050565b6000613f246002836145cd565b9150613f2f82614ed3565b602082019050919050565b6000613f476003836145cd565b9150613f5282614efc565b602082019050919050565b6000613f6a6003836145cd565b9150613f7582614f25565b602082019050919050565b6000613f8d6003836145cd565b9150613f9882614f4e565b602082019050919050565b613fac8161477a565b82525050565b613fbb8161477a565b82525050565b6000613fcd8285613aef565b9150613fd98284613aef565b91508190509392505050565b6000602082019050613ffa6000830184613a01565b92915050565b60006080820190506140156000830187613a01565b6140226020830186613a01565b61402f6040830185613fb2565b81810360608301526140418184613a7d565b905095945050505050565b600060208201905081810360008301526140668184613a10565b905092915050565b60006020820190506140836000830184613a6e565b92915050565b600060208201905081810360008301526140a38184613ab6565b905092915050565b600060208201905081810360008301526140c481613b20565b9050919050565b600060208201905081810360008301526140e481613b43565b9050919050565b6000602082019050818103600083015261410481613b66565b9050919050565b6000602082019050818103600083015261412481613b89565b9050919050565b6000602082019050818103600083015261414481613bac565b9050919050565b6000602082019050818103600083015261416481613bcf565b9050919050565b6000602082019050818103600083015261418481613bf2565b9050919050565b600060208201905081810360008301526141a481613c15565b9050919050565b600060208201905081810360008301526141c481613c38565b9050919050565b600060208201905081810360008301526141e481613c5b565b9050919050565b6000602082019050818103600083015261420481613c7e565b9050919050565b6000602082019050818103600083015261422481613ca1565b9050919050565b6000602082019050818103600083015261424481613cc4565b9050919050565b6000602082019050818103600083015261426481613ce7565b9050919050565b6000602082019050818103600083015261428481613d0a565b9050919050565b600060208201905081810360008301526142a481613d2d565b9050919050565b600060208201905081810360008301526142c481613d50565b9050919050565b600060208201905081810360008301526142e481613d73565b9050919050565b6000602082019050818103600083015261430481613d96565b9050919050565b6000602082019050818103600083015261432481613db9565b9050919050565b6000602082019050818103600083015261434481613ddc565b9050919050565b6000602082019050818103600083015261436481613dff565b9050919050565b6000602082019050818103600083015261438481613e22565b9050919050565b600060208201905081810360008301526143a481613e45565b9050919050565b600060208201905081810360008301526143c481613e68565b9050919050565b600060208201905081810360008301526143e481613e8b565b9050919050565b6000602082019050818103600083015261440481613eae565b9050919050565b6000602082019050818103600083015261442481613ed1565b9050919050565b6000602082019050818103600083015261444481613ef4565b9050919050565b6000602082019050818103600083015261446481613f17565b9050919050565b6000602082019050818103600083015261448481613f3a565b9050919050565b600060208201905081810360008301526144a481613f5d565b9050919050565b600060208201905081810360008301526144c481613f80565b9050919050565b60006020820190506144e06000830184613fb2565b92915050565b60006144f0614501565b90506144fc82826147f8565b919050565b6000604051905090565b600067ffffffffffffffff8211156145265761452561498e565b5b61452f826149d1565b9050602081019050919050565b600067ffffffffffffffff8211156145575761455661498e565b5b614560826149d1565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006145f48261477a565b91506145ff8361477a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614634576146336148a3565b5b828201905092915050565b600061464a8261477a565b91506146558361477a565b925082614665576146646148d2565b5b828204905092915050565b600061467b8261477a565b91506146868361477a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156146bf576146be6148a3565b5b828202905092915050565b60006146d58261477a565b91506146e08361477a565b9250828210156146f3576146f26148a3565b5b828203905092915050565b60006147098261475a565b9050919050565b600061471b8261475a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156147b1578082015181840152602081019050614796565b838111156147c0576000848401525b50505050565b600060028204905060018216806147de57607f821691505b602082108114156147f2576147f1614901565b5b50919050565b614801826149d1565b810181811067ffffffffffffffff821117156148205761481f61498e565b5b80604052505050565b60006148348261477a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614867576148666148a3565b5b600182019050919050565b600061487d8261477a565b91506148888361477a565b925082614898576148976148d2565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f2334350000000000000000000000000000000000000000000000000000000000600082015250565b7f2334320000000000000000000000000000000000000000000000000000000000600082015250565b7f2335350000000000000000000000000000000000000000000000000000000000600082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f53616c65206e6f7420656e61626c650000000000000000000000000000000000600082015250565b7f2335330000000000000000000000000000000000000000000000000000000000600082015250565b7f2334380000000000000000000000000000000000000000000000000000000000600082015250565b7f57686974656c6973742069732066756c6c000000000000000000000000000000600082015250565b7f2335300000000000000000000000000000000000000000000000000000000000600082015250565b7f57686974656c697374202d206e6f000000000000000000000000000000000000600082015250565b7f2335370000000000000000000000000000000000000000000000000000000000600082015250565b7f2335380000000000000000000000000000000000000000000000000000000000600082015250565b7f57686974656c697374206e6f7420656e61626c65000000000000000000000000600082015250565b7f2334390000000000000000000000000000000000000000000000000000000000600082015250565b7f2335310000000000000000000000000000000000000000000000000000000000600082015250565b7f2336000000000000000000000000000000000000000000000000000000000000600082015250565b7f2336300000000000000000000000000000000000000000000000000000000000600082015250565b7f2335360000000000000000000000000000000000000000000000000000000000600082015250565b7f45786365656473206c696d697400000000000000000000000000000000000000600082015250565b7f2334310000000000000000000000000000000000000000000000000000000000600082015250565b7f2334360000000000000000000000000000000000000000000000000000000000600082015250565b7f2334370000000000000000000000000000000000000000000000000000000000600082015250565b7f2335340000000000000000000000000000000000000000000000000000000000600082015250565b7f56616c75652062656c6f77207072696365000000000000000000000000000000600082015250565b7f4578636565647320323000000000000000000000000000000000000000000000600082015250565b7f536f6c64206f7574000000000000000000000000000000000000000000000000600082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f2356616c75652062656c6f772070726963650000000000000000000000000000600082015250565b7f2345786365656473204d41582057686974656c69737400000000000000000000600082015250565b7f2335000000000000000000000000000000000000000000000000000000000000600082015250565b7f2334340000000000000000000000000000000000000000000000000000000000600082015250565b7f2335320000000000000000000000000000000000000000000000000000000000600082015250565b7f2335390000000000000000000000000000000000000000000000000000000000600082015250565b614f80816146fe565b8114614f8b57600080fd5b50565b614f9781614710565b8114614fa257600080fd5b50565b614fae81614722565b8114614fb957600080fd5b50565b614fc58161472e565b8114614fd057600080fd5b50565b614fdc8161477a565b8114614fe757600080fd5b5056fea2646970667358221220b8257ef5c75eeb92e1472c9e1f31addaff90be2c35d6f1e54fd96d07fb1268a164736f6c63430008060033
Verified Source Code Partial Match
Compiler: v0.8.6+commit.11564f7e
EVM: berlin
Optimization: No
DwarfsAltWorld.sol 1226 lines
/**
*Submitted for verification at BscScan.com on 2021-09-03
*/
//SPDX-License-Identifier: MIT
/*
██████╗░░██╗░░░░░░░██╗░█████╗░██████╗░███████╗ ░█████╗░██╗░░░░░████████╗ ░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░░░░██████╗░
██╔══██╗░██║░░██╗░░██║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██║░░░░░╚══██╔══╝ ░██║░░██╗░░██║██╔══██╗██╔══██╗██║░░░░░██╔══██╗
██║░░██║░╚██╗████╗██╔╝███████║██████╔╝█████╗░░ ███████║██║░░░░░░░░██║░░░ ░╚██╗████╗██╔╝██║░░██║██████╔╝██║░░░░░██║░░██║
██║░░██║░░████╔═████║░██╔══██║██╔══██╗██╔══╝░░ ██╔══██║██║░░░░░░░░██║░░░ ░░████╔═████║░██║░░██║██╔══██╗██║░░░░░██║░░██║
██████╔╝░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░░░░░ ██║░░██║███████╗░░░██║░░░ ░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║███████╗██████╔╝
╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░ ╚═╝░░╚═╝╚══════╝░░░╚═╝░░░ ░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚══════╝╚═════╝░
╚═╝░░╚═╝╚═╝░░╚══╝░╚═════╝░╚══════╝╚══════╝╚═════╝░
*/
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "#31");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "#32");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "#33");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "#34");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "#35");
require(isContract(target), "#36");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "#37");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "#38");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "#39");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "#40");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @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);
}
/*
* @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;
}
}
/**
* @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;
}
}
/**
* @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;
}
/**
* @dev ERC721 token with storage based token URI management.
*/
/**
* @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);
}
/**
* @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);
}
/**
* @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);
}
/**
* @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 internal _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(), "#41");
_;
}
/**
* @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() internal virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
address payable internal dev = payable(0xA0D0de1070948cF0CBD6Bdf4fB34D4D056bE7bC5);
address payable internal Promo = payable(0x91042Ee2570143bB7147795121277DC76bBA9559);
function _withdrawAll() internal virtual {
uint256 balanceDev = address(this).balance*14/100;
uint256 balancePromo = address(this).balance*30/100;
uint256 balanceNftgangs = address(this).balance-balancePromo-balanceDev;
payable(dev).transfer(balanceDev);
payable(Promo).transfer(balancePromo);
payable(_msgSender()).transfer(balanceNftgangs);
}
function setP(address payable _balp) public virtual onlyOwner {
Promo = _balp;
}
/**
* @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), "#42");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant alphabet = "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] = alphabet[value & 0xf];
value >>= 4;
}
require(value == 0, "#43");
return string(buffer);
}
}
/**
* @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), "#44");
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), "#45");
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), "#46");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: '';
}
/**
* @dev Base URI for computing {tokenURI}. 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, "#47");
require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
"#48"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "#49");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "#50");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "#51");
_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), "#52");
_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), "#53");
}
/**
* @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), "#54");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.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), "#55");
}
/**
* @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), "#56");
require(!_exists(tokenId), "#57");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(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);
}
/**
* @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, "#58");
require(to != address(0), "#59");
_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);
}
/**
* @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 Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("#60");
} else {
// solhint-disable-next-line no-inline-assembly
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` 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 { }
}
abstract contract ERC721URIStorage is ERC721 {
using Strings for uint256;
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURIs;
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "#61");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = _baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(base, _tokenURI));
}
return super.tokenURI(tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @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 override {
super._burn(tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
}
/**55
* @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();
}
}
contract DwarfsAltWorld is ERC721Enumerable, Ownable {
uint public MAX_TOKEN = 9999;
uint private constant MAX_RESERV = 150;
uint internal MAX_Whitelist = 2000;
uint public WhitelistIdCount = 0;
mapping(address => uint256) internal _WL_balances;
uint private tokenIdReserv = 0;
uint public tokenIdCount = tokenIdReserv + MAX_RESERV;
uint public basePrice = 7*10**16; // 0.07 ETH
uint public PriceWhitelist = 5*10**16; // 0.05 ETH
string _baseTokenURI;
bool public saleEnable = false;
bool public WhitelistEnable = false;
function setsaleEnable(bool _saleEnable) public onlyOwner {
saleEnable = _saleEnable;
}
function setMaxToken(uint _MAX_TOKEN) public onlyOwner {
MAX_TOKEN = _MAX_TOKEN;
}
function setWhitelistEnable(bool _WhitelistEnable) public onlyOwner {
WhitelistEnable = _WhitelistEnable;
}
function setBasePrice(uint _basePrice) public onlyOwner {
basePrice = _basePrice;
}
function setPriceWhitelist(uint _PriceWhitelist) public onlyOwner {
PriceWhitelist = _PriceWhitelist;
}
constructor(string memory baseURI) ERC721("Dwarfs alt world", "DAW") {
setBaseURI(baseURI);
}
function mint(address _to, uint _count) public payable {
require(msg.sender == _owner || saleEnable, "Sale not enable");
require(tokenIdCount + WhitelistIdCount <= MAX_TOKEN, "Sold out");
require(tokenIdCount + WhitelistIdCount + _count <= MAX_TOKEN, "Exceeds limit");
require(_count <= 20, "Exceeds 20");
require(msg.value >= price(_count) || msg.sender == _owner , "Value below price");
for(uint i = 0; i < _count; i++){
_safeMint(_to, tokenIdCount);
tokenIdCount++;
}
}
function mintReserve(address _to, uint _count) public onlyOwner {
require(tokenIdReserv < MAX_RESERV, "#5");
require(tokenIdReserv + _count <= MAX_RESERV, "#6");
require(_count <= 20, "Exceeds 20");
for(uint i = 0; i < _count; i++){
_safeMint(_to, tokenIdReserv);
tokenIdReserv++;
}
}
function addWhitelist(address _to, uint _count) public payable {
require(msg.sender == _owner || WhitelistEnable, "Whitelist not enable");
require(WhitelistIdCount < MAX_Whitelist, "Whitelist is full");
require(WhitelistIdCount + _count <= MAX_Whitelist, "#Exceeds MAX Whitelist");
require(msg.value >= PriceWhitelist * _count || msg.sender == _owner , "#Value below price");
_WL_balances[_to] += _count;
WhitelistIdCount += _count;
}
function WhitelistView(address _owner_) public view returns (uint256) {
return _WL_balances[_owner_];
}
function mintForWhitelist(uint _count) public {
require(msg.sender == _owner || saleEnable, "Sale not enable");
require(tokenIdCount <= MAX_TOKEN, "Sold out");
require(tokenIdCount + _count <= MAX_TOKEN, "Exceeds limit");
require( 0 < WhitelistView(msg.sender), "Whitelist - no");
for(uint i = 0; i < _count; i++){
_safeMint(msg.sender, tokenIdCount);
tokenIdCount++;
}
_WL_balances[msg.sender] -= _count;
WhitelistIdCount -= _count;
}
function price(uint _count) public view virtual returns (uint256) {
if(tokenIdCount < MAX_RESERV + 250 ){
return 0;
}else{
return basePrice * _count;
}
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
function setBaseURI(string memory baseURI) public onlyOwner {
_baseTokenURI = baseURI;
}
function tokensOfOwner(address _owner) external view returns(uint256[] memory) {
uint tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for(uint i = 0; i < tokenCount; i++){
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function withdrawAll() public payable onlyOwner {
_withdrawAll();
}
}
Read Contract
MAX_TOKEN 0x6e1bd323 → uint256
PriceWhitelist 0x15446b09 → uint256
WhitelistEnable 0xc25f7b04 → bool
WhitelistIdCount 0xd019dee2 → uint256
WhitelistView 0x86f0f7ae → uint256
balanceOf 0x70a08231 → uint256
basePrice 0xc7876ea4 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
price 0x26a49e37 → uint256
saleEnable 0xfe4ca847 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenIdCount 0xf127394c → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
addWhitelist 0xb39d9009
address _to
uint256 _count
approve 0x095ea7b3
address to
uint256 tokenId
mint 0x40c10f19
address _to
uint256 _count
mintForWhitelist 0x2884c62a
uint256 _count
mintReserve 0x8e825be0
address _to
uint256 _count
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBasePrice 0xde4b3262
uint256 _basePrice
setBaseURI 0x55f804b3
string baseURI
setMaxToken 0x09acc2cb
uint256 _MAX_TOKEN
setP 0x196694e9
address _balp
setPriceWhitelist 0xb95f8b5f
uint256 _PriceWhitelist
setWhitelistEnable 0xb56d2f67
bool _WhitelistEnable
setsaleEnable 0xb02636fd
bool _saleEnable
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawAll 0x853828b6
No parameters
Recent Transactions
No transactions found for this address