0 txs
163.2k calls
constructor
constructor()
functions
DEFAULT_PROTOCOL_REWARD_BPS
viewfunction DEFAULT_PROTOCOL_REWARD_BPS() view returns (uint256)
getRoyaltyInfoWithCap
viewfunction getRoyaltyInfoWithCap(address collection, uint256 tokenId, uint256 amountInWei) view returns (address creator, uint256 royaltyAmount)
MAX_BPS
viewfunction MAX_BPS() view returns (uint256)
MAX_PROTOCOL_REWARD_BPS
viewfunction MAX_PROTOCOL_REWARD_BPS() view returns (uint256)
MAX_ROYALTY_BPS
viewfunction MAX_ROYALTY_BPS() view returns (uint256)
nextOfferId
viewfunction nextOfferId() view returns (uint256)
offers
viewfunction offers(uint256 offerId) view returns (uint256 offerId, address payer, address collection, uint256 tokenId, uint256 amount, uint256 priceInWei, uint256 expiresAt, address tokenRecipient, bool accepted)
owner
viewfunction owner() view returns (address)
pendingOwner
viewfunction pendingOwner() view returns (address)
protocolRewardBps
viewfunction protocolRewardBps() view returns (uint256)
proxiableUUID
viewfunction proxiableUUID() view returns (bytes32)
SEND_VALUE_GAS_LIMIT_MULTIPLE_RECIPIENTS
viewfunction SEND_VALUE_GAS_LIMIT_MULTIPLE_RECIPIENTS() view returns (uint256)
SEND_VALUE_GAS_LIMIT_SINGLE_RECIPIENT
viewfunction SEND_VALUE_GAS_LIMIT_SINGLE_RECIPIENT() view returns (uint256)
treasury
viewfunction treasury() view returns (address)
UPGRADE_INTERFACE_VERSION
viewfunction UPGRADE_INTERFACE_VERSION() view returns (string)
validateOfferWithId
viewfunction validateOfferWithId(uint256 offerId, uint256 tokenId, address seller) view returns (uint8)
weth
viewfunction weth() view returns (address)
acceptOffer
nonpayablefunction acceptOffer(uint256 offerId, uint256 tokenId, address paymentRecipient)
acceptOwnership
nonpayablefunction acceptOwnership()
createOffer
payablefunction createOffer(address collection, uint256 tokenId, uint256 amount, uint256 priceInWei, uint256 expiresAt, address tokenRecipient) payable returns (uint256 offerId)
initialize
nonpayablefunction initialize(address admin_, address weth_, address treasury_)
ownerSetProtocolRewardBps
nonpayablefunction ownerSetProtocolRewardBps(uint256 protocolRewardBps_)
ownerSetTreasury
nonpayablefunction ownerSetTreasury(address treasury_)
ownerWithdrawETH
nonpayablefunction ownerWithdrawETH(address to, uint256 amount)
renounceOwnership
nonpayablefunction renounceOwnership()
transferOwnership
nonpayablefunction transferOwnership(address newOwner)
upgradeToAndCall
payablefunction upgradeToAndCall(address newImplementation, bytes data) payable
events
ETHWithdrawn
event ETHWithdrawn(address indexed owner, address indexed to, uint256 amount)
ETHWithdrawnToWETH
event ETHWithdrawnToWETH(address indexed user, uint256 amount, bool success)
Initialized
event Initialized(uint64 version)
OfferAccepted
event OfferAccepted(address indexed acceptor, uint256 indexed offerId, uint256 indexed tokenId, address paymentRecipient, address tokenRecipient, address payer)
OfferCreated
event OfferCreated(address indexed payer, address indexed collection, uint256 tokenId, uint256 amount, uint256 priceInWei, uint256 expiresAt, address tokenRecipient, uint256 indexed offerId)
OfferPaymentsSent
event OfferPaymentsSent(uint256 indexed offerId, address protocolRewardRecipient, uint256 protocolRewardAmount, address royaltyRecipient, uint256 royaltyAmount, address paymentRecipient, uint256 paymentAmount)
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
OwnershipTransferStarted
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)
ProtocolRewardBpsSet
event ProtocolRewardBpsSet(address indexed owner, uint256 protocolRewardBps)
TreasurySet
event TreasurySet(address indexed owner, address treasury)
Upgraded
event Upgraded(address indexed implementation)
errors
AcceptOfferAlreadyAccepted
error AcceptOfferAlreadyAccepted(uint256 offerId)
AcceptOfferExpired
error AcceptOfferExpired(uint256 offerId, uint256 expiresAt, uint256 currentTime)
AcceptOfferIdNotValid
error AcceptOfferIdNotValid(uint256 offerId)
AcceptOfferNotFromOwner
error AcceptOfferNotFromOwner(uint256 offerId, address offerAcceptor)
AcceptOfferTokenIdMismatched
error AcceptOfferTokenIdMismatched(uint256 offerId, address collection, uint256 offerTokenId, uint256 acceptTokenId)
AcceptOfferWETHTransferFailed
error AcceptOfferWETHTransferFailed(uint256 offerId, address from, address to, uint256 amount)
AddressCannotBeZero
error AddressCannotBeZero()
AddressEmptyCode
error AddressEmptyCode(address target)
CreateOfferWETHTransferFailed
error CreateOfferWETHTransferFailed(address to, uint256 amount)
ERC1967InvalidImplementation
error ERC1967InvalidImplementation(address implementation)
ERC1967NonPayable
error ERC1967NonPayable()
FailedCall
error FailedCall()
InvalidInitialization
error InvalidInitialization()
InvalidProtocolRewardBps
error InvalidProtocolRewardBps(uint256 protocolRewardBps)
NotInitializing
error NotInitializing()
OwnableInvalidOwner
error OwnableInvalidOwner(address owner)
OwnableUnauthorizedAccount
error OwnableUnauthorizedAccount(address account)
UUPSUnauthorizedCallContext
error UUPSUnauthorizedCallContext()
UUPSUnsupportedProxiableUUID
error UUPSUnsupportedProxiableUUID(bytes32 slot)
creation bytecode
0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d4565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100725760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100d15780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051611f1b6100fd600039600081816113b5015281816113de015261151f0152611f1b6000f3fe6080604052600436106101a05760003560e01c806367836c38116100ec578063b40ad8da1161008a578063e30c397811610064578063e30c39781461051c578063f2fde38b14610531578063f7a9b40e14610551578063fd967f471461056857600080fd5b8063b40ad8da146104e7578063b47db76114610252578063c0c53b8b146104fc57600080fd5b80638a72ea6a116100c65780638a72ea6a146103b35780638da5cb5b1461048157806393307c4b14610496578063ad3cb1cc146104a957600080fd5b806367836c3814610373578063715018a61461038957806379ba50971461039e57600080fd5b80634f1ef286116101595780635e4db5a1116101335780635e4db5a1146102ee5780635f5d06551461030e5780635fb017851461032557806361d027b31461035257600080fd5b80634f1ef286146102af57806352d1902d146102c25780635ccb1390146102d757600080fd5b806303ab56ac146101ac57806307ae6a5d146101ce5780632e01b8a3146101ee57806331375242146102325780633dca40e6146102525780633fc8cef31461027657600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101cc6101c7366004611acb565b61057e565b005b3480156101da57600080fd5b506101cc6101e9366004611af9565b6105f0565b3480156101fa57600080fd5b5061020e610209366004611b32565b6107d0565b604080516001600160a01b0390931683526020830191909152015b60405180910390f35b34801561023e57600080fd5b506101cc61024d366004611b67565b61088d565b34801561025e57600080fd5b5061026861138881565b604051908152602001610229565b34801561028257600080fd5b506103e854610297906001600160a01b031681565b6040516001600160a01b039091168152602001610229565b6101cc6102bd366004611b9a565b61090d565b3480156102ce57600080fd5b5061026861092c565b3480156102e357600080fd5b506102686203345081565b3480156102fa57600080fd5b506101cc610309366004611c66565b610949565b34801561031a57600080fd5b506102686103ea5481565b34801561033157600080fd5b50610345610340366004611af9565b6109da565b6040516102299190611ca8565b34801561035e57600080fd5b506103e954610297906001600160a01b031681565b34801561037f57600080fd5b50610268614e2081565b34801561039557600080fd5b506101cc610a7b565b3480156103aa57600080fd5b506101cc610a8f565b3480156103bf57600080fd5b5061042d6103ce366004611acb565b6103eb602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015495966001600160a01b0395861696948616959394929391929091811690600160a01b900460ff1689565b60408051998a526001600160a01b0398891660208b0152968816968901969096526060880194909452608087019290925260a086015260c085015290911660e0830152151561010082015261012001610229565b34801561048d57600080fd5b50610297610ad7565b6102686104a4366004611cd0565b610b0c565b3480156104b557600080fd5b506104da604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516102299190611d52565b3480156104f357600080fd5b5061026860fa81565b34801561050857600080fd5b506101cc610517366004611d85565b610d76565b34801561052857600080fd5b50610297610f3b565b34801561053d57600080fd5b506101cc61054c366004611b67565b610f64565b34801561055d57600080fd5b506102686103e75481565b34801561057457600080fd5b5061026861271081565b610586610fe9565b6113888111156105b15760405163998dc1b560e01b8152600481018290526024015b60405180910390fd5b6103e781905560405181815233907f61143574fbcb9f5bdb303e42eb4fb569e32f40d192cac50f82c5dcb60ca7d8f4906020015b60405180910390a250565b60008381526103eb60209081526040808320815161012081018352815480825260018301546001600160a01b039081169583019590955260028301548516938201939093526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015492831660e0820152600160a01b90920460ff1615156101008301529091036106a15760405163472e0b5f60e01b8152600481018590526024016105a8565b6106ab818461101b565b60008481526103eb6020908152604091829020600701805460ff60a01b1916600160a01b17905560e08301518382015183516001600160a01b0387811682529283169381019390935216918101919091528390859033907f2dc2e57214af402f4196774f1e428d8453075ed9f1d2dc37892f1673bd06cb519060600160405180910390a460408181015160e083015160808401519251637921219560e11b81523360048201526001600160a01b03918216602482015260448101879052606481019390935260a06084840152600060a484015290919082169063f242432a9060c401600060405180830381600087803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b505050506107c98284611149565b5050505050565b60405163152a902d60e11b8152600481018390526024810182905260009081906001600160a01b03861690632a55205a906044016040805180830381865afa92505050801561083c575060408051601f3d908101601f1916820190925261083991810190611dc5565b60015b61084b57506000905080610885565b8193506000612710611388876108619190611e09565b61086b9190611e20565b90508082111561087d57809350610881565b8193505b5050505b935093915050565b610895610fe9565b6001600160a01b0381166108bc576040516303988b8160e61b815260040160405180910390fd5b6103e980546001600160a01b0319166001600160a01b03831690811790915560405190815233907f21eb548722a564f6e09f039f7aa858ae94c911910f3823b37af2250eeca4f403906020016105e5565b6109156113aa565b61091e8261144f565b6109288282611457565b5050565b6000610936611514565b50600080516020611ec683398151915290565b610951610fe9565b6001600160a01b038216610978576040516303988b8160e61b815260040160405180910390fd5b6103e8546109969083908390614e20906001600160a01b031661155d565b6040518181526001600160a01b0383169033907fc81b1761d304f16ef2aeae3a8611d9bd1d618adfff67d5157365cfb1251395329060200160405180910390a35050565b60008381526103eb602090815260408083208151610120810183528154815260018201546001600160a01b039081169482019490945260028201548416928101929092526003810154606083015260048101546080830152600581015460a0830152600681015460c08301526007015491821660e0820152600160a01b90910460ff161515610100820152610a708185856116e2565b9150505b9392505050565b610a83610fe9565b610a8d60006117bf565b565b3380610a99610f3b565b6001600160a01b031614610acb5760405163118cdaa760e01b81526001600160a01b03821660048201526024016105a8565b610ad4816117bf565b50565b6000807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b6103ea5460408051610120810182528281523360208083018281526001600160a01b038c8116858701818152606087018e8152608088018e815260a089018e815260c08a018e81528d871660e08c0190815260006101008d018181528f82526103eb909b528d90209b518c55975160018c0180549189166001600160a01b0319928316179055945160028c0180549189169190961617909455915160038a015551600489015551600588015551600687015591516007909501805493511515600160a01b026001600160a81b031990941695909116949094179190911790925591518392907fb52d03f658f2b5770408afe451ccdb703fdb28e6503e00c938eb24e5a55159f490610c4d908b908b908b908b908b909485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b60405180910390a46103ea8054906000610c6683611e42565b90915550506103e85460408051630d0e30db60e41b815290516001600160a01b0390921691829163d0e30db091349160048082019260009290919082900301818588803b158015610cb657600080fd5b505af1158015610cca573d6000803e3d6000fd5b505060405163a9059cbb60e01b8152336004820152346024820152600093506001600160a01b038516925063a9059cbb91506044016020604051808303816000875af1158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190611e5b565b905080610d6a57604051637532f88d60e11b81523360048201523460248201526044016105a8565b50509695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff16600081158015610dbc5750825b905060008267ffffffffffffffff166001148015610dd95750303b155b905081158015610de7575080155b15610e055760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610e2f57845460ff60401b1916600160401b1785555b6001600160a01b038816610e56576040516303988b8160e61b815260040160405180910390fd5b6001600160a01b038716610e7d576040516303988b8160e61b815260040160405180910390fd5b6001600160a01b038616610ea4576040516303988b8160e61b815260040160405180910390fd5b610ead886117f7565b60fa6103e7556103e880546001600160a01b03808a166001600160a01b0319928316179092556103e980549289169290911691909117905560016103ea558315610f3157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050565b6000807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610afc565b610f6c610fe9565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610fb0610ad7565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b33610ff2610ad7565b6001600160a01b031614610a8d5760405163118cdaa760e01b81523360048201526024016105a8565b60006110288383336116e2565b9050600181600481111561103e5761103e611c92565b036110625782516040516333ce20f360e01b815260048101919091526024016105a8565b600281600481111561107657611076611c92565b036110aa57825160c08401516040516310ca8a8f60e21b8152600481019290925260248201524260448201526064016105a8565b60038160048111156110be576110be611c92565b0361110657825160408085015160608601519151632a0ace0f60e01b815260048101939093526001600160a01b031660248301526044820152606481018390526084016105a8565b600481600481111561111a5761111a611c92565b036111445782516040516369d0fcbd60e01b815260048101919091523360248201526044016105a8565b505050565b600082608001518360a0015161115f9190611e09565b905060006127106103e754836111759190611e09565b61117f9190611e20565b905060008061119786604001518760600151866107d0565b90925090506000816111a98587611e7d565b6111b39190611e7d565b87516103e954604080516001600160a01b039283168152602081018990528783168183015260608101879052918a16608083015260a082018490525192935090917f13301ac831290e440725ce63600763944fd412bab740a7fb7928786c67224e5a9181900360c00190a26103e85460208801516040516323b872dd60e01b81526001600160a01b0391821660048201523060248201526044810188905260009291909116906323b872dd906064016020604051808303816000875af1158015611281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a59190611e5b565b9050806112eb5787516020890151604051631c957a9160e01b815260048101929092526001600160a01b03166024820152306044820152606481018790526084016105a8565b6103e854604051632e1a7d4d60e01b8152600481018890526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561133257600080fd5b505af1158015611346573d6000803e3d6000fd5b50506103e9546103e85461136e93506001600160a01b0391821692508891614e20911661155d565b6103e85461138c9085908590614e20906001600160a01b031661155d565b6103e854610f319088908490614e20906001600160a01b031661155d565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061143157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611425600080516020611ec6833981519152546001600160a01b031690565b6001600160a01b031614155b15610a8d5760405163703e46dd60e11b815260040160405180910390fd5b610ad4610fe9565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156114b1575060408051601f3d908101601f191682019092526114ae91810190611e90565b60015b6114d957604051634c9c8ce360e01b81526001600160a01b03831660048201526024016105a8565b600080516020611ec6833981519152811461150a57604051632a87526960e21b8152600481018290526024016105a8565b6111448383611808565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a8d5760405163703e46dd60e11b815260040160405180910390fd5b82156116dc576000846001600160a01b0316848490604051600060405180830381858888f193505050503d80600081146115b3576040519150601f19603f3d011682016040523d82523d6000602084013e6115b8565b606091505b50509050806107c9576000829050806001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b15801561160157600080fd5b505af1158015611615573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038a81166004830152602482018a9052600094508516925063a9059cbb91506044016020604051808303816000875af115801561166c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116909190611e5b565b6040805188815282151560208201529192506001600160a01b038916917fcac03b534fd581f08f64e77ce981c7e94e1ef450ef999fe757932630790fb1a1910160405180910390a25050505b50505050565b6000836101000151156116f757506001610a74565b8360c0015142111561170b57506002610a74565b828460600151141580156117225750606084015115155b1561172f57506003610a74565b6040848101519051627eeac760e11b81526001600160a01b0384811660048301526024820186905282169062fdd58e90604401602060405180830381865afa15801561177f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a39190611e90565b6000036117b4576004915050610a74565b506000949350505050565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b03191681556109288261185e565b6117ff6118cf565b610ad481611918565b6118118261194a565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118565761114482826119af565b610928611a27565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610a8d57604051631afcd79f60e31b815260040160405180910390fd5b6119206118cf565b6001600160a01b038116610acb57604051631e4fbdf760e01b8152600060048201526024016105a8565b806001600160a01b03163b60000361198057604051634c9c8ce360e01b81526001600160a01b03821660048201526024016105a8565b600080516020611ec683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516119cc9190611ea9565b600060405180830381855af49150503d8060008114611a07576040519150601f19603f3d011682016040523d82523d6000602084013e611a0c565b606091505b5091509150611a1c858383611a46565b925050505b92915050565b3415610a8d5760405163b398979f60e01b815260040160405180910390fd5b606082611a5b57611a5682611aa2565b610a74565b8151158015611a7257506001600160a01b0384163b155b15611a9b57604051639996b31560e01b81526001600160a01b03851660048201526024016105a8565b5080610a74565b805115611ab25780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b600060208284031215611add57600080fd5b5035919050565b6001600160a01b0381168114610ad457600080fd5b600080600060608486031215611b0e57600080fd5b83359250602084013591506040840135611b2781611ae4565b809150509250925092565b600080600060608486031215611b4757600080fd5b8335611b5281611ae4565b95602085013595506040909401359392505050565b600060208284031215611b7957600080fd5b8135610a7481611ae4565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611bad57600080fd5b8235611bb881611ae4565b9150602083013567ffffffffffffffff811115611bd457600080fd5b8301601f81018513611be557600080fd5b803567ffffffffffffffff811115611bff57611bff611b84565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611c2e57611c2e611b84565b604052818152828201602001871015611c4657600080fd5b816020840160208301376000602083830101528093505050509250929050565b60008060408385031215611c7957600080fd5b8235611c8481611ae4565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b6020810160058310611cca57634e487b7160e01b600052602160045260246000fd5b91905290565b60008060008060008060c08789031215611ce957600080fd5b8635611cf481611ae4565b95506020870135945060408701359350606087013592506080870135915060a0870135611d2081611ae4565b809150509295509295509295565b60005b83811015611d49578181015183820152602001611d31565b50506000910152565b6020815260008251806020840152611d71816040850160208701611d2e565b601f01601f19169190910160400192915050565b600080600060608486031215611d9a57600080fd5b8335611da581611ae4565b92506020840135611db581611ae4565b91506040840135611b2781611ae4565b60008060408385031215611dd857600080fd5b8251611de381611ae4565b6020939093015192949293505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417611a2157611a21611df3565b600082611e3d57634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611e5457611e54611df3565b5060010190565b600060208284031215611e6d57600080fd5b81518015158114610a7457600080fd5b81810381811115611a2157611a21611df3565b600060208284031215611ea257600080fd5b5051919050565b60008251611ebb818460208701611d2e565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201b3f5b80a35fb9d560d6150b4f45a15bad7324bbbc780ea8296c4d274037630c64736f6c634300081c0033