1 tx
52 calls
constructor
constructor(uint256 fee, address[] paymentTokens)
functions
FEE_MULTIPLIER
viewfunction FEE_MULTIPLIER() view returns (uint256)
getFee
viewfunction getFee() view returns (uint256)
getListing
viewfunction getListing(address token, uint256 tokenId) view returns (tuple)
isPaymentToken
viewfunction isPaymentToken(address _token) view returns (bool)
MAX_FEE
viewfunction MAX_FEE() view returns (uint256)
owner
viewfunction owner() view returns (address)
addPaymentToken
nonpayablefunction addPaymentToken(address _token)
cancelListing
nonpayablefunction cancelListing(address token, uint256 tokenId)
createListing
nonpayablefunction createListing(address token, uint256 tokenId, uint256 price)
createListingWithToken
nonpayablefunction createListingWithToken(address token, uint256 tokenId, uint256 price, address paymentToken)
purchaseListing
payablefunction purchaseListing(address token, uint256 tokenId) payable
purchaseListingWithToken
nonpayablefunction purchaseListingWithToken(address token, uint256 tokenId)
renounceOwnership
nonpayablefunction renounceOwnership()
setFee
nonpayablefunction setFee(uint256 newFee)
transferOwnership
nonpayablefunction transferOwnership(address newOwner)
updateListing
nonpayablefunction updateListing(address token, uint256 tokenId, uint256 newPrice)
withdraw
nonpayablefunction withdraw(address _token)
events
FeeSet
event FeeSet(uint256 newFee)
ListingCancelled
event ListingCancelled(address indexed seller, address indexed token, uint256 indexed tokenId)
ListingCreated
event ListingCreated(address indexed seller, address indexed token, uint256 indexed tokenId, uint256 price, address paymentToken)
ListingPurchased
event ListingPurchased(address indexed buyer, address indexed seller, address indexed token, uint256 tokenId, address paymentToken)
ListingUpdated
event ListingUpdated(address indexed seller, address indexed token, uint256 indexed tokenId, uint256 newPrice)
NewPaymentToken
event NewPaymentToken(address token)
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Withdrawal
event Withdrawal(address indexed by, uint256 amount)
errors
FailedToSendCoins
error FailedToSendCoins()
FailedToSendTokens
error FailedToSendTokens()
ListingAlreadyExist
error ListingAlreadyExist()
ListingDoesNotExist
error ListingDoesNotExist()
NotEnoughFundsSupplied
error NotEnoughFundsSupplied()
NotTheOwner
error NotTheOwner(uint256 tokenId, address sender)
NoValidFee
error NoValidFee()
NoValidPaymentToken
error NoValidPaymentToken()
OwnableInvalidOwner
error OwnableInvalidOwner(address owner)
OwnableUnauthorizedAccount
error OwnableUnauthorizedAccount(address account)
PaymentTokenAlreadyExist
error PaymentTokenAlreadyExist()
PaymentTokenTransferFailed
error PaymentTokenTransferFailed()
TokenNotApproved
error TokenNotApproved(uint256 tokenId)
ZeroPriceNotAllowed
error ZeroPriceNotAllowed()
creation bytecode
0x608060405234801561001057600080fd5b5060405161199c38038061199c83398101604081905261002f916101e6565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e816100e4565b5061006882610134565b600182905560005b81518110156100a9576100a182828151811061008e5761008e6102c2565b602002602001015161015a60201b60201c565b600101610070565b506040518281527f20461e09b8e557b77e107939f9ce6544698123aad0fc964ac5cc59b7df2e608f9060200160405180910390a150506102d8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6101f48111156101575760405163395ad50f60e21b815260040160405180910390fd5b50565b6001600160a01b038116600081815260026020908152604091829020805460ff1916600117905590519182527f8e7039b8b033352b9421db09ee909441172c2b03e63527a90b4592287a1371b4910160405180910390a150565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146101e157600080fd5b919050565b600080604083850312156101f957600080fd5b825160208401519092506001600160401b0381111561021757600080fd5b8301601f8101851361022857600080fd5b80516001600160401b03811115610241576102416101b4565b604051600582901b90603f8201601f191681016001600160401b038111828210171561026f5761026f6101b4565b60405291825260208184018101929081018884111561028d57600080fd5b6020850194505b838510156102b3576102a5856101ca565b815260209485019401610294565b50809450505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6116b5806102e76000396000f3fe6080604052600436106100fe5760003560e01c8063930eaddc11610095578063bc063e1a11610064578063bc063e1a146102da578063c2bd91c9146102f0578063ced72f8714610310578063f2fde38b14610325578063f772adf11461034557600080fd5b8063930eaddc1461023a578063a7fc91b914610283578063b2ddee0614610296578063b591b13c146102b657600080fd5b806369fe0e2d116100d157806369fe0e2d14610185578063715018a6146101a557806388700d1c146101ba5780638da5cb5b1461021257600080fd5b806324780c5614610103578063429e7540146101255780634a7dc8e01461014557806351cff8d914610165575b600080fd5b34801561010f57600080fd5b5061012361011e3660046114dd565b610365565b005b34801561013157600080fd5b50610123610140366004611512565b61059c565b34801561015157600080fd5b5061012361016036600461155c565b61080a565b34801561017157600080fd5b5061012361018036600461155c565b61085b565b34801561019157600080fd5b506101236101a0366004611580565b610a1e565b3480156101b157600080fd5b50610123610a6b565b3480156101c657600080fd5b506101da6101d5366004611599565b610a7f565b60408051825181526020808401516001600160a01b039081169183019190915292820151909216908201526060015b60405180910390f35b34801561021e57600080fd5b506000546040516001600160a01b039091168152602001610209565b34801561024657600080fd5b5061027361025536600461155c565b6001600160a01b031660009081526002602052604090205460ff1690565b6040519015158152602001610209565b610123610291366004611599565b610aee565b3480156102a257600080fd5b506101236102b1366004611599565b610cc8565b3480156102c257600080fd5b506102cc61271081565b604051908152602001610209565b3480156102e657600080fd5b506102cc6101f481565b3480156102fc57600080fd5b5061012361030b366004611599565b610e28565b34801561031c57600080fd5b506001546102cc565b34801561033157600080fd5b5061012361034036600461155c565b6110a5565b34801561035157600080fd5b506101236103603660046114dd565b6110e3565b6040516331a9108f60e11b8152600481018390528390839033906001600160a01b03841690636352211e90602401602060405180830381865afa1580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d491906115c5565b6001600160a01b03161461040957604051630df6426560e11b8152600481018290523360248201526044015b60405180910390fd5b828060000361042b5760405163a2b326dd60e01b815260040160405180910390fd5b6001600160a01b03861660009081526003602090815260408083208884529091529020548690869015610471576040516337080f2760e11b815260040160405180910390fd5b60405163e985e9c560e01b8152336004820152306024820152889088906001600160a01b0383169063e985e9c590604401602060405180830381865afa1580156104bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e391906115e2565b158015610562575060405163020604bf60e21b81526004810182905230906001600160a01b0384169063081812fc90602401602060405180830381865afa158015610532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055691906115c5565b6001600160a01b031614155b15610583576040516330b46bfb60e11b815260048101829052602401610400565b6105908a8a8a6000611251565b50505050505050505050565b6040516331a9108f60e11b8152600481018490528490849033906001600160a01b03841690636352211e90602401602060405180830381865afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b91906115c5565b6001600160a01b03161461063b57604051630df6426560e11b815260048101829052336024820152604401610400565b838060000361065d5760405163a2b326dd60e01b815260040160405180910390fd5b6001600160a01b038716600090815260036020908152604080832089845290915290205487908790156106a3576040516337080f2760e11b815260040160405180910390fd5b60405163e985e9c560e01b8152336004820152306024820152899089906001600160a01b0383169063e985e9c590604401602060405180830381865afa1580156106f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071591906115e2565b158015610794575060405163020604bf60e21b81526004810182905230906001600160a01b0384169063081812fc90602401602060405180830381865afa158015610764573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078891906115c5565b6001600160a01b031614155b156107b5576040516330b46bfb60e11b815260048101829052602401610400565b6001600160a01b038816600090815260026020526040902054889060ff166107f0576040516346d6537760e01b815260040160405180910390fd5b6107fc8c8c8c8c611251565b505050505050505050505050565b610812611301565b6001600160a01b038116600090815260026020526040902054819060ff161561084e57604051632992bcb360e11b815260040160405180910390fd5b6108578261132e565b5050565b610863611301565b604051478082529033907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a26001600160a01b03821661091657604051600090339083908381818185875af1925050503d80600081146108ea576040519150601f19603f3d011682016040523d82523d6000602084013e6108ef565b606091505b505090508061091157604051632f08378760e21b815260040160405180910390fd5b505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190611604565b60405163a9059cbb60e01b8152336004820152602481018290529091506000906001600160a01b0385169063a9059cbb906044016020604051808303816000875af11580156109d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f891906115e2565b905080610a185760405163d17fea7960e01b815260040160405180910390fd5b50505050565b610a26611301565b610a2f81611382565b60018190556040518181527f20461e09b8e557b77e107939f9ce6544698123aad0fc964ac5cc59b7df2e608f906020015b60405180910390a150565b610a73611301565b610a7d60006113a5565b565b6040805160608101825260008082526020820181905291810191909152506001600160a01b038083166000908152600360209081526040808320858452825291829020825160608101845281548152600182015485169281019290925260020154909216908201525b92915050565b6001600160a01b0382166000908152600360209081526040808320848452909152812054839183919003610b35576040516335aacf6560e11b815260040160405180910390fd5b6001600160a01b03808516600090815260036020908152604080832087845282529182902082516060810184528154815260018201548516928101929092526002015490921690820181905234919015610ba2576040516346d6537760e01b815260040160405180910390fd5b8051821015610bc4576040516311d5b1cb60e11b815260040160405180910390fd5b6000610bd687848885602001516113f5565b9050866001600160a01b031682602001516001600160a01b0316336001600160a01b03167fbeb53e8ab8a8c716c9d2668598613da31da6aaa020928418d0f69fcd14e7700f896000604051610c3e9291909182526001600160a01b0316602082015260400190565b60405180910390a4600082602001516001600160a01b03168260405160006040518083038185875af1925050503d8060008114610c97576040519150601f19603f3d011682016040523d82523d6000602084013e610c9c565b606091505b5050905080610cbe57604051632f08378760e21b815260040160405180910390fd5b5050505050505050565b6040516331a9108f60e11b8152600481018290528290829033906001600160a01b03841690636352211e90602401602060405180830381865afa158015610d13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3791906115c5565b6001600160a01b031614610d6757604051630df6426560e11b815260048101829052336024820152604401610400565b6001600160a01b0384166000908152600360209081526040808320868452909152812054859185919003610dae576040516335aacf6560e11b815260040160405180910390fd5b6001600160a01b03861660008181526003602090815260408083208984529091528082208281556001810180546001600160a01b03199081169091556002909101805490911690555187929133917fe1bfe61cb157e0896411ccf9a5c40e4c346f7bb6e1d2a44de4a724f0cb5c6fb09190a4505050505050565b6001600160a01b0382166000908152600360209081526040808320848452909152812054839183919003610e6f576040516335aacf6560e11b815260040160405180910390fd5b6001600160a01b038085166000908152600360209081526040808320878452825291829020825160608101845281548152600182015485169281019290925260020154909216908201819052610ed8576040516346d6537760e01b815260040160405180910390fd5b604080820151825191516323b872dd60e01b815233600482015230602482015260448101929092526000916001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5b91906115e2565b905080610f7b5760405163149902fd60e31b815260040160405180910390fd5b6000610f918784600001518886602001516113f5565b9050866001600160a01b031683602001516001600160a01b0316336001600160a01b03167fbeb53e8ab8a8c716c9d2668598613da31da6aaa020928418d0f69fcd14e7700f898760400151604051610ffc9291909182526001600160a01b0316602082015260400190565b60405180910390a46040808401516020850151915163a9059cbb60e01b81526001600160a01b039283166004820152602481018490526000929091169063a9059cbb906044016020604051808303816000875af1158015611061573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108591906115e2565b905080610cbe5760405163d17fea7960e01b815260040160405180910390fd5b6110ad611301565b6001600160a01b0381166110d757604051631e4fbdf760e01b815260006004820152602401610400565b6110e0816113a5565b50565b6040516331a9108f60e11b8152600481018390528390839033906001600160a01b03841690636352211e90602401602060405180830381865afa15801561112e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115291906115c5565b6001600160a01b03161461118257604051630df6426560e11b815260048101829052336024820152604401610400565b6001600160a01b03851660009081526003602090815260408083208784529091528120548691869190036111c9576040516335aacf6560e11b815260040160405180910390fd5b84806000036111eb5760405163a2b326dd60e01b815260040160405180910390fd5b6001600160a01b03881660008181526003602090815260408083208b8452825291829020899055905188815289929133917f0af55bb2d5976cf0b636ba8903d1f3a441f6056ded6bc491dcfad6d2e0827e16910160405180910390a45050505050505050565b604080516060810182528381523360208083018281526001600160a01b038681168587018181528b83166000818152600387528981208d825287528990209751885593516001880180549185166001600160a01b031992831617905590516002909701805497909316961695909517905584518781529182019390935286937fe6ba83c888c09d409e467eefeec7bda77da4002d60ad4bfa002949773f5f5e74910160405180910390a450505050565b6000546001600160a01b03163314610a7d5760405163118cdaa760e01b8152336004820152602401610400565b6001600160a01b038116600081815260026020908152604091829020805460ff1916600117905590519182527f8e7039b8b033352b9421db09ee909441172c2b03e63527a90b4592287a1371b49101610a60565b6101f48111156110e05760405163395ad50f60e21b815260040160405180910390fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0384811660008181526003602090815260408083208784529091528082208281556001810180546001600160a01b031990811690915560029091018054909116905551632142170760e11b8152928416600484015233602484015260448301859052916342842e0e90606401600060405180830381600087803b15801561148257600080fd5b505af1158015611496573d6000803e3d6000fd5b50505050612710600154856114ab9190611633565b6114b5919061164a565b6114bf908561166c565b95945050505050565b6001600160a01b03811681146110e057600080fd5b6000806000606084860312156114f257600080fd5b83356114fd816114c8565b95602085013595506040909401359392505050565b6000806000806080858703121561152857600080fd5b8435611533816114c8565b935060208501359250604085013591506060850135611551816114c8565b939692955090935050565b60006020828403121561156e57600080fd5b8135611579816114c8565b9392505050565b60006020828403121561159257600080fd5b5035919050565b600080604083850312156115ac57600080fd5b82356115b7816114c8565b946020939093013593505050565b6000602082840312156115d757600080fd5b8151611579816114c8565b6000602082840312156115f457600080fd5b8151801515811461157957600080fd5b60006020828403121561161657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610ae857610ae861161d565b60008261166757634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115610ae857610ae861161d56fea2646970667358221220b826b0a57db060e8cf344ddaf7a4fe824b77a55af83dd84fc02f3efbc2e1b25064736f6c634300081c003300000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831