Address Contract Partially Verified
Address
0xFC0d0430cc11eFfB068007306d6EfD9b2Ac7a460
Balance
0 ETH
Nonce
1
Code Size
18790 bytes
Creator
0xd3Dd622E...85bF at tx 0xfcd59976...fb0096
Indexed Transactions
0
Contract Bytecode
18790 bytes
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806370a0823111610104578063b88d4fde116100a2578063ddf7fcb011610071578063ddf7fcb01461054e578063e985e9c51461056c578063f2fde38b1461059c578063f6a74ed7146105b8576101da565b8063b88d4fde146104b6578063c87b56dd146104d2578063da8c229e14610502578063dbbdf08314610532576101da565b806395d89b41116100de57806395d89b411461043057806396e494e81461044e578063a22cb4651461047e578063a7fc7a071461049a576101da565b806370a08231146103d8578063715018a6146104085780638da5cb5b14610412576101da565b80632a55205a1161017c57806352dc67161161014b57806352dc67161461035457806355f804b3146103705780635944c7531461038c5780636352211e146103a8576101da565b80632a55205a146102cd57806342842e0e146102fe5780634e543b261461031a578063513ddfc014610336576101da565b8063081812fc116101b8578063081812fc14610249578063095ea7b31461027957806323b872dd1461029557806328ed4f6c146102b1576101da565b806301ffc9a7146101df57806304634d8d1461020f57806306fdde031461022b575b600080fd5b6101f960048036038101906101f49190613168565b6105d4565b60405161020691906131b0565b60405180910390f35b6102296004803603810190610224919061326d565b61064e565b005b6102336106b2565b604051610240919061333d565b60405180910390f35b610263600480360381019061025e9190613395565b610744565b60405161027091906133d1565b60405180910390f35b610293600480360381019061028e91906133ec565b61078a565b005b6102af60048036038101906102aa919061342c565b6108a1565b005b6102cb60048036038101906102c6919061347f565b610a83565b005b6102e760048036038101906102e291906134bf565b610a91565b6040516102f592919061350e565b60405180910390f35b6103186004803603810190610313919061342c565b610c7b565b005b610334600480360381019061032f9190613537565b610e5d565b005b61033e610ef9565b60405161034b91906135c3565b60405180910390f35b61036e6004803603810190610369919061347f565b610f1f565b005b61038a60048036038101906103859190613713565b610f2f565b005b6103a660048036038101906103a1919061375c565b610f4a565b005b6103c260048036038101906103bd9190613395565b610fb1565b6040516103cf91906133d1565b60405180910390f35b6103f260048036038101906103ed9190613537565b611037565b6040516103ff91906137af565b60405180910390f35b6104106110ee565b005b61041a611102565b60405161042791906133d1565b60405180910390f35b61043861112c565b604051610445919061333d565b60405180910390f35b61046860048036038101906104639190613395565b6111be565b60405161047591906131b0565b60405180910390f35b610498600480360381019061049391906137f6565b6111d1565b005b6104b460048036038101906104af9190613537565b6111e7565b005b6104d060048036038101906104cb91906138d7565b6111fb565b005b6104ec60048036038101906104e79190613395565b6113e0565b6040516104f9919061333d565b60405180910390f35b61051c60048036038101906105179190613537565b611448565b60405161052991906131b0565b60405180910390f35b61054c6004803603810190610547919061347f565b611468565b005b610556611478565b6040516105639190613973565b60405180910390f35b6105866004803603810190610581919061398e565b61147e565b60405161059391906131b0565b60405180910390f35b6105b660048036038101906105b19190613537565b611512565b005b6105d260048036038101906105cd9190613537565b611595565b005b60007f2baae9fd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106475750610646826115a9565b5b9050919050565b61065661168b565b6106608282611709565b8173ffffffffffffffffffffffffffffffffffffffff167fa1edde4ed5c1392c90dccd8e051a4080b761850e49a24c77d826348a51e1f8dc826040516106a691906139dd565b60405180910390a25050565b6060600280546106c190613a27565b80601f01602080910402602001604051908101604052809291908181526020018280546106ed90613a27565b801561073a5780601f1061070f5761010080835404028352916020019161073a565b820191906000526020600020905b81548152906001019060200180831161071d57829003601f168201915b5050505050905090565b600061074f8261189d565b6006600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061079582610fb1565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610805576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fc90613aca565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108246118e8565b73ffffffffffffffffffffffffffffffffffffffff16148061085357506108528161084d6118e8565b61147e565b5b610892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088990613b5c565b60405180910390fd5b61089c83836118f0565b505050565b8260006daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b1115610a71573373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109135761090e8484846119a9565b610a7d565b6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430336040518363ffffffff1660e01b815260040161095c929190613b7c565b602060405180830381865afa158015610979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099d9190613bba565b8015610a2f57506daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b81526004016109ed929190613b7c565b602060405180830381865afa158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2e9190613bba565b5b610a7057336040517fede71dcc000000000000000000000000000000000000000000000000000000008152600401610a6791906133d1565b60405180910390fd5b5b610a7c8484846119a9565b5b50505050565b610a8d8282611a09565b5050565b6000806000600160008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610c265760006040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610c30611b9d565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610c5c9190613c16565b610c669190613c87565b90508160000151819350935050509250929050565b8260006daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b1115610e4b573373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ced57610ce8848484611ba7565b610e57565b6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430336040518363ffffffff1660e01b8152600401610d36929190613b7c565b602060405180830381865afa158015610d53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d779190613bba565b8015610e0957506daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b8152600401610dc7929190613b7c565b602060405180830381865afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e089190613bba565b5b610e4a57336040517fede71dcc000000000000000000000000000000000000000000000000000000008152600401610e4191906133d1565b60405180910390fd5b5b610e56848484611ba7565b5b50505050565b610e6561168b565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631896f70a600c54836040518363ffffffff1660e01b8152600401610ec4929190613cb8565b600060405180830381600087803b158015610ede57600080fd5b505af1158015610ef2573d6000803e3d6000fd5b5050505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f2b82826000611bc7565b5050565b610f3761168b565b80600a9081610f469190613e83565b5050565b610f5261168b565b610f5d838383611e42565b8173ffffffffffffffffffffffffffffffffffffffff16837f2595213009f64247e2789cf9981bcc53ee736a6aa52042a651aa1549ae6fff6183604051610fa491906139dd565b60405180910390a3505050565b600080610fbd83611fe9565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361102e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102590613fa1565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e90614033565b60405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6110f661168b565b6111006000612026565b565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461113b90613a27565b80601f016020809104026020016040519081016040528092919081815260200182805461116790613a27565b80156111b45780601f10611189576101008083540402835291602001916111b4565b820191906000526020600020905b81548152906001019060200180831161119757829003601f168201915b5050505050905090565b60006111c9826120ec565b159050919050565b6111e36111dc6118e8565b838361212d565b5050565b6111ef61168b565b6111f881612299565b50565b8360006daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b11156113cc573373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361126e5761126985858585612337565b6113d9565b6daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430336040518363ffffffff1660e01b81526004016112b7929190613b7c565b602060405180830381865afa1580156112d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f89190613bba565b801561138a57506daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b8152600401611348929190613b7c565b602060405180830381865afa158015611365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113899190613bba565b5b6113cb57336040517fede71dcc0000000000000000000000000000000000000000000000000000000081526004016113c291906133d1565b60405180910390fd5b5b6113d885858585612337565b5b5050505050565b60606113eb8261189d565b60006113f5612399565b905060008151116114155760405180602001604052806000815250611440565b8061141f8461242b565b60405160200161143092919061408f565b6040516020818303038152906040525b915050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b61147482826001611bc7565b5050565b600c5481565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61151a61168b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611589576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158090614125565b60405180910390fd5b61159281612026565b50565b61159d61168b565b6115a6816124f9565b50565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061167457507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611684575061168382612597565b5b9050919050565b6116936118e8565b73ffffffffffffffffffffffffffffffffffffffff166116b1611102565b73ffffffffffffffffffffffffffffffffffffffff1614611707576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fe90614191565b60405180910390fd5b565b611711611b9d565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff16111561176f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176690614223565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d59061428f565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152506000808201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b6118a6816120ec565b6118e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118dc90613fa1565b60405180910390fd5b50565b600033905090565b816006600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661196383610fb1565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6119ba6119b46118e8565b82612611565b6119f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f090614321565b60405180910390fd5b611a048383836126a6565b505050565b3073ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3600c546040518263ffffffff1660e01b8152600401611a7d9190613973565b602060405180830381865afa158015611a9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abe9190614356565b73ffffffffffffffffffffffffffffffffffffffff1614611ade57600080fd5b611ae83383612611565b611af157600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab5923600c548460001b846040518463ffffffff1660e01b8152600401611b5593929190614383565b6020604051808303816000875af1158015611b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9891906143e6565b505050565b6000612710905090565b611bc2838383604051806020016040528060008152506111fb565b505050565b3073ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3600c546040518263ffffffff1660e01b8152600401611c3b9190613973565b602060405180830381865afa158015611c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c7c9190614356565b73ffffffffffffffffffffffffffffffffffffffff1614611c9c57600080fd5b60096000611ca86118e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611cf957600080fd5b611d02836111be565b611d41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d389061445f565b60405180910390fd5b611d4b828461299f565b8015611dfa57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab5923600c548560001b856040518463ffffffff1660e01b8152600401611db593929190614383565b6020604051808303816000875af1158015611dd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df891906143e6565b505b8173ffffffffffffffffffffffffffffffffffffffff16837e834ad8d7a1d8421d149549c7292d11385f5a042a008771d26ffd2d76db6e7460405160405180910390a3505050565b611e4a611b9d565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115611ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9f90614223565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611f17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0e906144cb565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152506001600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550905050505050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff1661210e83611fe9565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361219b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219290614537565b60405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161228c91906131b0565b60405180910390a3505050565b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f0a8bb31534c0ed46f380cb867bd5c803a189ced9a764e30b3a4991a9901d747460405160405180910390a250565b6123486123426118e8565b83612611565b612387576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237e90614321565b60405180910390fd5b61239384848484612bbc565b50505050565b6060600a80546123a890613a27565b80601f01602080910402602001604051908101604052809291908181526020018280546123d490613a27565b80156124215780601f106123f657610100808354040283529160200191612421565b820191906000526020600020905b81548152906001019060200180831161240457829003601f168201915b5050505050905090565b60606000600161243a84612c18565b01905060008167ffffffffffffffff811115612459576124586135e8565b5b6040519080825280601f01601f19166020018201604052801561248b5781602001600182028036833780820191505090505b509050600082602001820190505b6001156124ee578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816124e2576124e1613c58565b5b04945060008503612499575b819350505050919050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f33d83959be2573f5453b12eb9d43b3499bc57d96bd2f067ba44803c859e8111360405160405180910390a250565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061260a575061260982612d6b565b5b9050919050565b60008061261d83610fb1565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061265f575061265e818561147e565b5b8061269d57508373ffffffffffffffffffffffffffffffffffffffff1661268584610744565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166126c682610fb1565b73ffffffffffffffffffffffffffffffffffffffff161461271c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612713906145c9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361278b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127829061465b565b60405180910390fd5b6127988383836001612dd5565b8273ffffffffffffffffffffffffffffffffffffffff166127b882610fb1565b73ffffffffffffffffffffffffffffffffffffffff161461280e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612805906145c9565b60405180910390fd5b6006600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461299a8383836001612e26565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612a0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a05906146c7565b60405180910390fd5b612a17816120ec565b15612a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4e90614733565b60405180910390fd5b612a65600083836001612dd5565b612a6e816120ec565b15612aae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa590614733565b60405180910390fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612bb8600083836001612e26565b5050565b612bc78484846126a6565b612bd384848484612e2c565b612c12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c09906147c5565b60405180910390fd5b50505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612c76577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612c6c57612c6b613c58565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612cb3576d04ee2d6d415b85acef81000000008381612ca957612ca8613c58565b5b0492506020810190505b662386f26fc100008310612ce257662386f26fc100008381612cd857612cd7613c58565b5b0492506010810190505b6305f5e1008310612d0b576305f5e1008381612d0157612d00613c58565b5b0492506008810190505b6127108310612d30576127108381612d2657612d25613c58565b5b0492506004810190505b60648310612d535760648381612d4957612d48613c58565b5b0492506002810190505b600a8310612d62576001810190505b80915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612de184848484612fb3565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614612e2057612e1f8284611a09565b5b50505050565b50505050565b6000612e4d8473ffffffffffffffffffffffffffffffffffffffff166130d9565b15612fa6578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612e766118e8565b8786866040518563ffffffff1660e01b8152600401612e98949392919061483a565b6020604051808303816000875af1925050508015612ed457506040513d601f19601f82011682018060405250810190612ed1919061489b565b60015b612f56573d8060008114612f04576040519150601f19603f3d011682016040523d82523d6000602084013e612f09565b606091505b506000815103612f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f45906147c5565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612fab565b600190505b949350505050565b60018111156130d357600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146130475780600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461303f91906148c8565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146130d25780600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546130ca91906148fc565b925050819055505b5b50505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61314581613110565b811461315057600080fd5b50565b6000813590506131628161313c565b92915050565b60006020828403121561317e5761317d613106565b5b600061318c84828501613153565b91505092915050565b60008115159050919050565b6131aa81613195565b82525050565b60006020820190506131c560008301846131a1565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006131f6826131cb565b9050919050565b613206816131eb565b811461321157600080fd5b50565b600081359050613223816131fd565b92915050565b60006bffffffffffffffffffffffff82169050919050565b61324a81613229565b811461325557600080fd5b50565b60008135905061326781613241565b92915050565b6000806040838503121561328457613283613106565b5b600061329285828601613214565b92505060206132a385828601613258565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156132e75780820151818401526020810190506132cc565b60008484015250505050565b6000601f19601f8301169050919050565b600061330f826132ad565b61331981856132b8565b93506133298185602086016132c9565b613332816132f3565b840191505092915050565b600060208201905081810360008301526133578184613304565b905092915050565b6000819050919050565b6133728161335f565b811461337d57600080fd5b50565b60008135905061338f81613369565b92915050565b6000602082840312156133ab576133aa613106565b5b60006133b984828501613380565b91505092915050565b6133cb816131eb565b82525050565b60006020820190506133e660008301846133c2565b92915050565b6000806040838503121561340357613402613106565b5b600061341185828601613214565b925050602061342285828601613380565b9150509250929050565b60008060006060848603121561344557613444613106565b5b600061345386828701613214565b935050602061346486828701613214565b925050604061347586828701613380565b9150509250925092565b6000806040838503121561349657613495613106565b5b60006134a485828601613380565b92505060206134b585828601613214565b9150509250929050565b600080604083850312156134d6576134d5613106565b5b60006134e485828601613380565b92505060206134f585828601613380565b9150509250929050565b6135088161335f565b82525050565b600060408201905061352360008301856133c2565b61353060208301846134ff565b9392505050565b60006020828403121561354d5761354c613106565b5b600061355b84828501613214565b91505092915050565b6000819050919050565b600061358961358461357f846131cb565b613564565b6131cb565b9050919050565b600061359b8261356e565b9050919050565b60006135ad82613590565b9050919050565b6135bd816135a2565b82525050565b60006020820190506135d860008301846135b4565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613620826132f3565b810181811067ffffffffffffffff8211171561363f5761363e6135e8565b5b80604052505050565b60006136526130fc565b905061365e8282613617565b919050565b600067ffffffffffffffff82111561367e5761367d6135e8565b5b613687826132f3565b9050602081019050919050565b82818337600083830152505050565b60006136b66136b184613663565b613648565b9050828152602081018484840111156136d2576136d16135e3565b5b6136dd848285613694565b509392505050565b600082601f8301126136fa576136f96135de565b5b813561370a8482602086016136a3565b91505092915050565b60006020828403121561372957613728613106565b5b600082013567ffffffffffffffff8111156137475761374661310b565b5b613753848285016136e5565b91505092915050565b60008060006060848603121561377557613774613106565b5b600061378386828701613380565b935050602061379486828701613214565b92505060406137a586828701613258565b9150509250925092565b60006020820190506137c460008301846134ff565b92915050565b6137d381613195565b81146137de57600080fd5b50565b6000813590506137f0816137ca565b92915050565b6000806040838503121561380d5761380c613106565b5b600061381b85828601613214565b925050602061382c858286016137e1565b9150509250929050565b600067ffffffffffffffff821115613851576138506135e8565b5b61385a826132f3565b9050602081019050919050565b600061387a61387584613836565b613648565b905082815260208101848484011115613896576138956135e3565b5b6138a1848285613694565b509392505050565b600082601f8301126138be576138bd6135de565b5b81356138ce848260208601613867565b91505092915050565b600080600080608085870312156138f1576138f0613106565b5b60006138ff87828801613214565b945050602061391087828801613214565b935050604061392187828801613380565b925050606085013567ffffffffffffffff8111156139425761394161310b565b5b61394e878288016138a9565b91505092959194509250565b6000819050919050565b61396d8161395a565b82525050565b60006020820190506139886000830184613964565b92915050565b600080604083850312156139a5576139a4613106565b5b60006139b385828601613214565b92505060206139c485828601613214565b9150509250929050565b6139d781613229565b82525050565b60006020820190506139f260008301846139ce565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613a3f57607f821691505b602082108103613a5257613a516139f8565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ab46021836132b8565b9150613abf82613a58565b604082019050919050565b60006020820190508181036000830152613ae381613aa7565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000613b46603d836132b8565b9150613b5182613aea565b604082019050919050565b60006020820190508181036000830152613b7581613b39565b9050919050565b6000604082019050613b9160008301856133c2565b613b9e60208301846133c2565b9392505050565b600081519050613bb4816137ca565b92915050565b600060208284031215613bd057613bcf613106565b5b6000613bde84828501613ba5565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613c218261335f565b9150613c2c8361335f565b9250828202613c3a8161335f565b91508282048414831517613c5157613c50613be7565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c928261335f565b9150613c9d8361335f565b925082613cad57613cac613c58565b5b828204905092915050565b6000604082019050613ccd6000830185613964565b613cda60208301846133c2565b9392505050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302613d437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613d06565b613d4d8683613d06565b95508019841693508086168417925050509392505050565b6000613d80613d7b613d768461335f565b613564565b61335f565b9050919050565b6000819050919050565b613d9a83613d65565b613dae613da682613d87565b848454613d13565b825550505050565b600090565b613dc3613db6565b613dce818484613d91565b505050565b5b81811015613df257613de7600082613dbb565b600181019050613dd4565b5050565b601f821115613e3757613e0881613ce1565b613e1184613cf6565b81016020851015613e20578190505b613e34613e2c85613cf6565b830182613dd3565b50505b505050565b600082821c905092915050565b6000613e5a60001984600802613e3c565b1980831691505092915050565b6000613e738383613e49565b9150826002028217905092915050565b613e8c826132ad565b67ffffffffffffffff811115613ea557613ea46135e8565b5b613eaf8254613a27565b613eba828285613df6565b600060209050601f831160018114613eed5760008415613edb578287015190505b613ee58582613e67565b865550613f4d565b601f198416613efb86613ce1565b60005b82811015613f2357848901518255600182019150602085019450602081019050613efe565b86831015613f405784890151613f3c601f891682613e49565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000613f8b6018836132b8565b9150613f9682613f55565b602082019050919050565b60006020820190508181036000830152613fba81613f7e565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b600061401d6029836132b8565b915061402882613fc1565b604082019050919050565b6000602082019050818103600083015261404c81614010565b9050919050565b600081905092915050565b6000614069826132ad565b6140738185614053565b93506140838185602086016132c9565b80840191505092915050565b600061409b828561405e565b91506140a7828461405e565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061410f6026836132b8565b915061411a826140b3565b604082019050919050565b6000602082019050818103600083015261413e81614102565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061417b6020836132b8565b915061418682614145565b602082019050919050565b600060208201905081810360008301526141aa8161416e565b9050919050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b600061420d602a836132b8565b9150614218826141b1565b604082019050919050565b6000602082019050818103600083015261423c81614200565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b60006142796019836132b8565b915061428482614243565b602082019050919050565b600060208201905081810360008301526142a88161426c565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b600061430b602d836132b8565b9150614316826142af565b604082019050919050565b6000602082019050818103600083015261433a816142fe565b9050919050565b600081519050614350816131fd565b92915050565b60006020828403121561436c5761436b613106565b5b600061437a84828501614341565b91505092915050565b60006060820190506143986000830186613964565b6143a56020830185613964565b6143b260408301846133c2565b949350505050565b6143c38161395a565b81146143ce57600080fd5b50565b6000815190506143e0816143ba565b92915050565b6000602082840312156143fc576143fb613106565b5b600061440a848285016143d1565b91505092915050565b7f7468697320646964206973206e6f7420617661696c61626c6500000000000000600082015250565b60006144496019836132b8565b915061445482614413565b602082019050919050565b600060208201905081810360008301526144788161443c565b9050919050565b7f455243323938313a20496e76616c696420706172616d65746572730000000000600082015250565b60006144b5601b836132b8565b91506144c08261447f565b602082019050919050565b600060208201905081810360008301526144e4816144a8565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006145216019836132b8565b915061452c826144eb565b602082019050919050565b6000602082019050818103600083015261455081614514565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006145b36025836132b8565b91506145be82614557565b604082019050919050565b600060208201905081810360008301526145e2816145a6565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006146456024836132b8565b9150614650826145e9565b604082019050919050565b6000602082019050818103600083015261467481614638565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006146b16020836132b8565b91506146bc8261467b565b602082019050919050565b600060208201905081810360008301526146e0816146a4565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b600061471d601c836132b8565b9150614728826146e7565b602082019050919050565b6000602082019050818103600083015261474c81614710565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006147af6032836132b8565b91506147ba82614753565b604082019050919050565b600060208201905081810360008301526147de816147a2565b9050919050565b600081519050919050565b600082825260208201905092915050565b600061480c826147e5565b61481681856147f0565b93506148268185602086016132c9565b61482f816132f3565b840191505092915050565b600060808201905061484f60008301876133c2565b61485c60208301866133c2565b61486960408301856134ff565b818103606083015261487b8184614801565b905095945050505050565b6000815190506148958161313c565b92915050565b6000602082840312156148b1576148b0613106565b5b60006148bf84828501614886565b91505092915050565b60006148d38261335f565b91506148de8361335f565b92508282039050818111156148f6576148f5613be7565b5b92915050565b60006149078261335f565b91506149128361335f565b925082820190508082111561492a57614929613be7565b5b9291505056fea264697066735822122018ad817ce6bb8d51b444773fbe4d41fcc37dfb9e82167f5d736679e741b0a33664736f6c63430008110033
Verified Source Code Partial Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
KEY3FreeRegistrar.sol 2286 lines
// File: opensea/IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator)
external
view
returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription)
external;
function registerAndCopyEntries(
address registrant,
address registrantToCopy
) external;
function updateOperator(
address registrant,
address operator,
bool filtered
) external;
function updateOperators(
address registrant,
address[] calldata operators,
bool filtered
) external;
function updateCodeHash(
address registrant,
bytes32 codehash,
bool filtered
) external;
function updateCodeHashes(
address registrant,
bytes32[] calldata codeHashes,
bool filtered
) external;
function subscribe(address registrant, address registrantToSubscribe)
external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant)
external
returns (address[] memory);
function subscriberAt(address registrant, uint256 index)
external
returns (address);
function copyEntriesOf(address registrant, address registrantToCopy)
external;
function isOperatorFiltered(address registrant, address operator)
external
returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode)
external
returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash)
external
returns (bool);
function filteredOperators(address addr)
external
returns (address[] memory);
function filteredCodeHashes(address addr)
external
returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index)
external
returns (address);
function filteredCodeHashAt(address registrant, uint256 index)
external
returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
// File: opensea/OperatorFilterer.sol
pragma solidity ^0.8.13;
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry constant operatorFilterRegistry =
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
// will not revert, but the contract will need to be registered with the registry once it is deployed in
// order for the modifier to filter addresses.
if (address(operatorFilterRegistry).code.length > 0) {
if (subscribe) {
operatorFilterRegistry.registerAndSubscribe(
address(this),
subscriptionOrRegistrantToCopy
);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
operatorFilterRegistry.registerAndCopyEntries(
address(this),
subscriptionOrRegistrantToCopy
);
} else {
operatorFilterRegistry.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(operatorFilterRegistry).code.length > 0) {
// Allow spending tokens from addresses with balance
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from == msg.sender) {
_;
return;
}
if (
!(operatorFilterRegistry.isOperatorAllowed(
address(this),
msg.sender
) &&
operatorFilterRegistry.isOperatorAllowed(
address(this),
from
))
) {
revert OperatorNotAllowed(msg.sender);
}
}
_;
}
}
// File: opensea/DefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
abstract contract DefaultOperatorFilterer is OperatorFilterer {
address constant DEFAULT_SUBSCRIPTION =
address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);
constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}
// File: IKEY3.sol
pragma solidity ^0.8.9;
interface IKEY3 {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
// Logged when an operator is added or removed.
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function setRecord(
bytes32 node,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeRecord(
bytes32 node,
bytes32 label,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeOwner(
bytes32 node,
bytes32 label,
address owner
) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function setApprovalForAll(address operator, bool approved) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
function recordExists(bytes32 node) external view returns (bool);
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: access/Controllable.sol
pragma solidity ^0.8.9;
contract Controllable is Context {
mapping(address => bool) public controllers;
event ControllerAdded(address indexed controller);
event ControllerRemoved(address indexed controller);
modifier onlyController() {
require(controllers[_msgSender()]);
_;
}
function _addController(address controller_) internal virtual {
controllers[controller_] = true;
emit ControllerAdded(controller_);
}
function _removeController(address controller_) internal virtual {
controllers[controller_] = false;
emit ControllerRemoved(controller_);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/interfaces/IERC2981.sol
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: resolvers/BaseResolver.sol
pragma solidity ^0.8.9;
abstract contract BaseResolver is ERC165 {
modifier authorised(bytes32 node) {
require(_isAuthorised(node));
_;
}
function _isAuthorised(bytes32 node) internal view virtual returns (bool);
function _bytesToAddress(bytes memory b)
internal
pure
returns (address payable a)
{
require(b.length == 20);
assembly {
a := div(mload(add(b, 32)), exp(256, 12))
}
}
function _addressToBytes(address a) internal pure returns (bytes memory b) {
b = new bytes(20);
assembly {
mstore(add(b, 32), mul(a, exp(256, 12)))
}
}
}
// File: resolvers/AddrResolver.sol
pragma solidity ^0.8.9;
abstract contract AddrResolver is BaseResolver {
bytes4 private constant ADDR_INTERFACE_ID = 0x3b3b57de;
bytes4 private constant ADDRESS_INTERFACE_ID = 0xf1cb7e06;
uint private constant COIN_TYPE_ETH = 60;
event AddrChanged(bytes32 indexed node, address a);
event AddressChanged(bytes32 indexed node, uint coinType, bytes newAddress);
mapping(bytes32 => mapping(uint => bytes)) _addresses;
/**
* Sets the address associated with an KEY3 node.
* May only be called by the owner of that node in the KEY3 registry.
* @param node The node to update.
* @param a The address to set.
*/
function setAddr(bytes32 node, address a) external authorised(node) {
setAddr(node, COIN_TYPE_ETH, _addressToBytes(a));
}
/**
* Returns the address associated with an KEY3 node.
* @param node The KEY3 node to query.
* @return The associated address.
*/
function addr(bytes32 node) public view returns (address payable) {
bytes memory a = addr(node, COIN_TYPE_ETH);
if (a.length == 0) {
return payable(address(0));
}
return _bytesToAddress(a);
}
function setAddr(
bytes32 node,
uint coinType,
bytes memory a
) public authorised(node) {
emit AddressChanged(node, coinType, a);
if (coinType == COIN_TYPE_ETH) {
emit AddrChanged(node, _bytesToAddress(a));
}
_addresses[node][coinType] = a;
}
function addr(bytes32 node, uint coinType)
public
view
returns (bytes memory)
{
return _addresses[node][coinType];
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == ADDR_INTERFACE_ID ||
interfaceId == ADDRESS_INTERFACE_ID ||
super.supportsInterface(interfaceId);
}
}
// File: @openzeppelin/contracts/token/common/ERC2981.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be pe...
// [truncated — 76275 bytes total]
Read Contract
available 0x96e494e8 → bool
balanceOf 0x70a08231 → uint256
baseNode 0xddf7fcb0 → bytes32
controllers 0xda8c229e → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
key3 0x513ddfc0 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
addController 0xa7fc7a07
address controller_
approve 0x095ea7b3
address to
uint256 tokenId
reclaim 0x28ed4f6c
uint256 id_
address owner_
register 0xdbbdf083
uint256 id_
address owner_
registerOnly 0x52dc6716
uint256 id_
address owner_
removeController 0xf6a74ed7
address controller_
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI_
setDefaultRoyalty 0x04634d8d
address receiver_
uint96 feeNumerator_
setResolver 0x4e543b26
address resolver_
setTokenRoyalty 0x5944c753
uint256 tokenId_
address receiver_
uint96 feeNumerator_
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address