Address Contract Verified
Address
0x6657eEa3624f05184f238F72dB81A10Cc20117D6
Balance
0 ETH
Nonce
1
Code Size
11429 bytes
Creator
0x7631a3EB...625E at tx 0x2ff615d0...a2db68
Indexed Transactions
0
Contract Bytecode
11429 bytes
0x6080604052600436106101b75760003560e01c80637b334154116100ec578063d34e95841161008a578063f1648e8411610064578063f1648e841461051c578063f23a6e61146105b3578063f2fde38b146105e0578063feec756c1461060057600080fd5b8063d34e9584146104bc578063d4a8a09e146104dc578063ed54be2b146104fc57600080fd5b8063a4d611bb116100c6578063a4d611bb1461043a578063b32fdcea1461045a578063bc197c811461046d578063cc46740f1461049c57600080fd5b80637b334154146103cc5780638da5cb5b146103fc5780639546f95e1461041a57600080fd5b8063524cef5d1161015957806366d003ac1161013357806366d003ac146103495780636a52bd451461038157806370ab51ef14610397578063715018a6146103b757600080fd5b8063524cef5d146102e957806360ba6fe214610309578063613a7b481461032957600080fd5b80632590f55b116101955780632590f55b14610256578063385878331461027a5780633abe3d861461029c5780634022d7d2146102bc57600080fd5b806301ffc9a7146101bc578063150b7a02146101f1578063240028e814610236575b600080fd5b3480156101c857600080fd5b506101dc6101d7366004612327565b610620565b60405190151581526020015b60405180910390f35b3480156101fd57600080fd5b5061021d61020c3660046123b5565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101e8565b34801561024257600080fd5b506101dc610251366004612423565b610657565b34801561026257600080fd5b5061026c60045481565b6040519081526020016101e8565b34801561028657600080fd5b5061029a61029536600461243e565b61075c565b005b3480156102a857600080fd5b5061029a6102b736600461249b565b6108f0565b3480156102c857600080fd5b506102dc6102d7366004612506565b610999565b6040516101e89190612560565b3480156102f557600080fd5b5061029a610304366004612629565b610b3a565b34801561031557600080fd5b5061029a61032436600461243e565b610cdc565b34801561033557600080fd5b5061029a610344366004612423565b610e7b565b34801561035557600080fd5b50600254610369906001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b34801561038d57600080fd5b5061026c60035481565b3480156103a357600080fd5b5061029a6103b2366004612680565b610f68565b3480156103c357600080fd5b5061029a610fcd565b3480156103d857600080fd5b506101dc6103e7366004612423565b60076020526000908152604090205460ff1681565b34801561040857600080fd5b506001546001600160a01b0316610369565b34801561042657600080fd5b5061029a610435366004612423565b611003565b34801561044657600080fd5b5061029a610455366004612680565b6110bd565b61029a610468366004612506565b61111c565b34801561047957600080fd5b5061021d6104883660046126c1565b63bc197c8160e01b98975050505050505050565b3480156104a857600080fd5b5061026c6104b736600461277b565b6112a0565b3480156104c857600080fd5b5061029a6104d73660046127de565b6115ac565b3480156104e857600080fd5b5061026c6104f736600461291b565b611717565b34801561050857600080fd5b5061029a61051736600461294e565b611755565b34801561052857600080fd5b5061059d61053736600461243e565b60056020819052600091825260409091208054600182015460028301546003840154600485015495850154600686015460078701546008909701546001600160a01b038088169960ff600160a01b9099048916999790911697959694959094921691908a565b6040516101e89a9998979695949392919061297a565b3480156105bf57600080fd5b5061021d6105ce3660046129de565b63f23a6e6160e01b9695505050505050565b3480156105ec57600080fd5b5061029a6105fb366004612423565b611a62565b34801561060c57600080fd5b5061029a61061b366004612423565b611afd565b60006001600160e01b03198216630271189760e51b148061065157506001600160e01b031982166301ffc9a760e01b145b92915050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526000906001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156106a057600080fd5b505afa1580156106b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d89190612a55565b8061065157506040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b15801561072457600080fd5b505afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106519190612a55565b6001546001600160a01b0316331461078f5760405162461bcd60e51b815260040161078690612a72565b60405180910390fd5b600081815260056020818152604080842081516101408101835281546001600160a01b038082168352600160a01b90910460ff90811615159583019590955260018301541692810192909252600281015460608301526003808201546080840152600482015460a08401529381015460c083015260068101549193909260e0850192169081111561082257610822612528565b600381111561083357610833612528565b815260078201546020820152600890910154604090910152905060018160e00151600381111561086557610865612528565b14610889578060e00151604051633310fdfd60e21b81526004016107869190612aa7565b6000828152600560205260408120600601805460ff1916905560048054916108b083612acb565b91905055506108c0600983611b9c565b5060405182907ff0c09fc4ad4780cd3530e4010cb31d6c0d38513f639dbade17158b4c5da4f8f490600090a25050565b6001546001600160a01b0316331461091a5760405162461bcd60e51b815260040161078690612a72565b8281811461093b5760405163150072e360e11b815260040160405180910390fd5b60005b818110156109915761098986868381811061095b5761095b612ae2565b9050602002013585858481811061097457610974612ae2565b90506020020160208101906105179190612423565b60010161093e565b505050505050565b606060006109a76009611baf565b9050806109b48486612af8565b10156109c7576109c48385612af8565b90505b6109cf6122d4565b6000846001600160401b038111156109e9576109e9612b10565b604051908082528060200260200182016040528015610a2257816020015b610a0f6122d4565b815260200190600190039081610a075790505b509350855b83811015610b305760056000610a3e600984611bb9565b8152602080820192909252604090810160002081516101408101835281546001600160a01b038082168352600160a01b90910460ff90811615159583019590955260018301541692810192909252600281015460608301526003808201546080840152600482015460a0840152600582015460c084015260068201549293919260e08501921690811115610ad457610ad4612528565b6003811115610ae557610ae5612528565b8152600782015460208201526008909101546040909101529250828583610b0b81612b26565b945081518110610b1d57610b1d612ae2565b6020908102919091010152600101610a27565b5050505092915050565b6001546001600160a01b03163314610b645760405162461bcd60e51b815260040161078690612a72565b6001600160a01b038516610b8b5760405163d92e233d60e01b815260040160405180910390fd5b8115610c185780610baf5760405163162908e360e11b815260040160405180910390fd5b604051637921219560e11b81526001600160a01b0385169063f242432a90610be1903090899088908790600401612b41565b600060405180830381600087803b158015610bfb57600080fd5b505af1158015610c0f573d6000803e3d6000fd5b50505050610c7b565b604051632142170760e11b81526001600160a01b038516906342842e0e90610c4890309089908890600401612b85565b600060405180830381600087803b158015610c6257600080fd5b505af1158015610c76573d6000803e3d6000fd5b505050505b604080516001600160a01b038088168252861660208201529081018490528215156060820152608081018290527fd332d4a7628495a03bfa805279083a1e47566d76250fb7e22c0a18372ff11f1b9060a00160405180910390a15050505050565b6001546001600160a01b03163314610d065760405162461bcd60e51b815260040161078690612a72565b600081815260056020818152604080842081516101408101835281546001600160a01b038082168352600160a01b90910460ff90811615159583019590955260018301541692810192909252600281015460608301526003808201546080840152600482015460a08401529381015460c083015260068101549193909260e08501921690811115610d9957610d99612528565b6003811115610daa57610daa612528565b815260078201546020820152600890910154604090910152905060008160e001516003811115610ddc57610ddc612528565b14158015610ded575060a081015115155b15610e11578060e00151604051633310fdfd60e21b81526004016107869190612aa7565b6000828152600560205260408120600601805460ff191660011790556004805491610e3b83612b26565b9190505550610e4b600983611bc5565b5060405182907f5664dadc2f9788b0d64f6eaaa92110b9cb7a7d0269659efb2708c83f039eb4d490600090a25050565b6001546001600160a01b03163314610ea55760405162461bcd60e51b815260040161078690612a72565b6001600160a01b038116610ecc5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03811660009081526007602052604090205460ff1615610f065760405163a741a04560e01b815260040160405180910390fd5b6001600160a01b038116600081815260076020908152604091829020805460ff191660019081179091558251938452908301527ff65e6fbd1e93e0dd0e55c099938c29aa43ad0f95a1e114dbf049b64ffab26a7291015b60405180910390a150565b6001546001600160a01b03163314610f925760405162461bcd60e51b815260040161078690612a72565b8060005b81811015610fc757610fbf848483818110610fb357610fb3612ae2565b90506020020135610cdc565b600101610f96565b50505050565b6001546001600160a01b03163314610ff75760405162461bcd60e51b815260040161078690612a72565b6110016000611bd1565b565b6001546001600160a01b0316331461102d5760405162461bcd60e51b815260040161078690612a72565b6001600160a01b03811660009081526007602052604090205460ff166110665760405163a741a04560e01b815260040160405180910390fd5b6001600160a01b0381166000818152600760209081526040808320805460ff191690558051938452908301919091527ff65e6fbd1e93e0dd0e55c099938c29aa43ad0f95a1e114dbf049b64ffab26a729101610f5d565b6001546001600160a01b031633146110e75760405162461bcd60e51b815260040161078690612a72565b8060005b81811015610fc75761111484848381811061110857611108612ae2565b9050602002013561075c565b6001016110eb565b6002600054141561116f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610786565b6002600081815583815260056020818152604080842081516101408101835281546001600160a01b038082168352600160a01b90910460ff908116151595830195909552600183015416928101929092529485015460608201526003808601546080830152600486015460a08301529285015460c0820152600685015493949093909260e0850192919091169081111561120b5761120b612528565b600381111561121c5761121c612528565b815260078201546020820152600890910154604090910152905060018160e00151600381111561124e5761124e612528565b14611272578060e00151604051633310fdfd60e21b81526004016107869190612aa7565b80602001511561128c57611287838284611c23565b611296565b6112968382611ea2565b5050600160005550565b3360009081526007602052604081205460ff166112d057604051630234e03f60e61b815260040160405180910390fd5b6112d987610657565b6112f65760405163c1ab6dc160e01b815260040160405180910390fd5b6001600160a01b038716600090815260086020908152604080832089845290915290205460ff161561133b576040516368cd03cd60e01b815260040160405180910390fd5b82156113c8578161135f5760405163162908e360e11b815260040160405180910390fd5b604051637921219560e11b81526001600160a01b0388169063f242432a9061139190889030908b908890600401612b41565b600060405180830381600087803b1580156113ab57600080fd5b505af11580156113bf573d6000803e3d6000fd5b5050505061142b565b604051632142170760e11b81526001600160a01b038816906342842e0e906113f890889030908b90600401612b85565b600060405180830381600087803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b505050505b600060036000815461143c90612b26565b9182905550600081815260056020526040902060028101899055805460038201889055426004830155600180830180546001600160a01b038c81166001600160a01b03199092169190911790915560068401805460ff191690921790915587158015600160a01b02918d166001600160a81b031990931692909217179091559091506114d75760008181526005602052604090206007018390555b6001600160a01b03881660009081526006602090815260408083208a8452825282208054600181018255908352912001819055611515600982611bc5565b506001600160a01b03881660009081526008602090815260408083208a84529091528120805460ff19166001179055600480549161155283612b26565b9091555050604080516001600160a01b038881168252602082018690528a1691899184917f1a265b8308b91509fe1d5fe9876807526b549b7dbb82e0542f5e35374a34484b910160405180910390a4979650505050505050565b3360009081526007602052604090205460ff166115dc57604051630234e03f60e61b815260040160405180910390fd5b8a89811415806115ec5750808814155b806115f75750808614155b806116025750808414155b8061160d5750808214155b1561162b5760405163150072e360e11b815260040160405180910390fd5b60005b81811015611707576116fe8e8e8381811061164b5761164b612ae2565b90506020020160208101906116609190612423565b8d8d8481811061167257611672612ae2565b905060200201358c8c8581811061168b5761168b612ae2565b90506020020160208101906116a09190612423565b8b8b868181106116b2576116b2612ae2565b905060200201358a8a878181106116cb576116cb612ae2565b90506020020160208101906116e09190612ba9565b8989888181106116f2576116f2612ae2565b905060200201356112a0565b5060010161162e565b5050505050505050505050505050565b6006602052826000526040600020602052816000526040600020818154811061173f57600080fd5b9060005260206000200160009250925050505481565b6001546001600160a01b0316331461177f5760405162461bcd60e51b815260040161078690612a72565b600082815260056020818152604080842081516101408101835281546001600160a01b038082168352600160a01b90910460ff90811615159583019590955260018301541692810192909252600281015460608301526003808201546080840152600482015460a08401529381015460c083015260068101549193909260e0850192169081111561181257611812612528565b600381111561182357611823612528565b815260078201546020820152600890910154604090910152905060018160e00151600381111561185557611855612528565b14158015611888575060008160e00151600381111561187657611876612528565b148015611886575060a081015115155b155b156118ac578060e00151604051633310fdfd60e21b81526004016107869190612aa7565b60006001600160a01b0383166118c65781604001516118c8565b825b905081602001511561195a5781600001516001600160a01b031663f242432a308385606001518661012001518761010001516119049190612bc6565b6040518563ffffffff1660e01b81526004016119239493929190612b41565b600060405180830381600087803b15801561193d57600080fd5b505af1158015611951573d6000803e3d6000fd5b505050506119c3565b81516060830151604051632142170760e11b81526001600160a01b03909216916342842e0e916119909130918691600401612b85565b600060405180830381600087803b1580156119aa57600080fd5b505af11580156119be573d6000803e3d6000fd5b505050505b6000848152600560208190526040822060068101805460ff191660031790554291015560048054916119f483612acb565b9190505550611a04600985611b9c565b5081516001600160a01b0316600090815260086020908152604080832060608601518452909152808220805460ff191690555185917f14a6417ce8382c89fad4cf7e2c13692d14a560f1843991f92b37e3237611c28d91a250505050565b6001546001600160a01b03163314611a8c5760405162461bcd60e51b815260040161078690612a72565b6001600160a01b038116611af15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610786565b611afa81611bd1565b50565b6001546001600160a01b03163314611b275760405162461bcd60e51b815260040161078690612a72565b6001600160a01b038116611b4e5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fc2014e920b7997caf84bdbe9af16ae22a197f2569d6da5087765e6593ae105de90602001610f5d565b6000611ba8838361209a565b9392505050565b6000610651825490565b6000611ba8838361218d565b6000611ba883836121b7565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b801580611c445750816101200151826101000151611c419190612bc6565b81115b15611c625760405163162908e360e11b815260040160405180910390fd5b6000826080015182611c749190612bdd565b905034811115611c9757604051632a9ffab760e21b815260040160405180910390fd5b82516060840151604051637921219560e11b81526001600160a01b039092169163f242432a91611ccf91309133918890600401612b41565b600060405180830381600087803b158015611ce957600080fd5b505af1158015611cfd573d6000803e3d6000fd5b5050505060006064826050611d129190612bdd565b611d1c9190612bfc565b9050611d2c846040015182612206565b600254611d4b906001600160a01b0316611d468385612bc6565b612206565b81341115611d6157611d6133611d468434612bc6565b60008581526005602052604081206008018054859290611d82908490612af8565b9091555050610100840151610120850151611d9e908590612af8565b1415611e3e576000858152600560208190526040822060068101805460ff19166002179055429101556004805491611dd583612acb565b9190505550611de5600986611b9c565b5083516001600160a01b0316600090815260086020908152604080832060608801518452909152808220805460ff191690555186917f0facf508594d6b73c4389159784fabc5e7b054812d87d36a103085bf0b847df891a25b835160608086015160808701516040805133815260208101899052908101919091526001600160a01b0390931692909188917f4b355f2033bcefeee423ca1690e88a781ec579ca9bf9180a9869f621b6f36f3a910160405180910390a45050505050565b3481608001511115611ec757604051632a9ffab760e21b815260040160405180910390fd5b80516060820151604051632142170760e11b81526001600160a01b03909216916342842e0e91611efd9130913391600401612b85565b600060405180830381600087803b158015611f1757600080fd5b505af1158015611f2b573d6000803e3d6000fd5b505050506000606482608001516050611f449190612bdd565b611f4e9190612bfc565b9050611f5e826040015182612206565b6002546080830151611f7f916001600160a01b031690611d46908490612bc6565b8160800151341115611f9f57611f9f33836080015134611d469190612bc6565b6000838152600560208190526040822060068101805460ff19166002179055429101556004805491611fd083612acb565b9190505550611fe0600984611b9c565b5081516001600160a01b0316600090815260086020908152604080832060608601518452909152808220805460ff191690555184917f0facf508594d6b73c4389159784fabc5e7b054812d87d36a103085bf0b847df891a2815160608084015160808501516040805133815260006020820152908101919091526001600160a01b0390931692909186917f4b355f2033bcefeee423ca1690e88a781ec579ca9bf9180a9869f621b6f36f3a910160405180910390a4505050565b600081815260018301602052604081205480156121835760006120be600183612bc6565b85549091506000906120d290600190612bc6565b90508181146121375760008660000182815481106120f2576120f2612ae2565b906000526020600020015490508087600001848154811061211557612115612ae2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061214857612148612c1e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610651565b6000915050610651565b60008260000182815481106121a4576121a4612ae2565b9060005260206000200154905092915050565b60008181526001830160205260408120546121fe57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610651565b506000610651565b604080516000808252602082019092526001600160a01b0384169083906040516122309190612c34565b60006040518083038185875af1925050503d806000811461226d576040519150601f19603f3d011682016040523d82523d6000602084013e612272565b606091505b50509050806122cf5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a205472616e73666572206661696c6564206044820152620cae8d60eb1b6064820152608401610786565b505050565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081018290529060e0820190815260200160008152602001600081525090565b60006020828403121561233957600080fd5b81356001600160e01b031981168114611ba857600080fd5b80356001600160a01b038116811461236857600080fd5b919050565b60008083601f84011261237f57600080fd5b5081356001600160401b0381111561239657600080fd5b6020830191508360208285010111156123ae57600080fd5b9250929050565b6000806000806000608086880312156123cd57600080fd5b6123d686612351565b94506123e460208701612351565b93506040860135925060608601356001600160401b0381111561240657600080fd5b6124128882890161236d565b969995985093965092949392505050565b60006020828403121561243557600080fd5b611ba882612351565b60006020828403121561245057600080fd5b5035919050565b60008083601f84011261246957600080fd5b5081356001600160401b0381111561248057600080fd5b6020830191508360208260051b85010111156123ae57600080fd5b600080600080604085870312156124b157600080fd5b84356001600160401b03808211156124c857600080fd5b6124d488838901612457565b909650945060208701359150808211156124ed57600080fd5b506124fa87828801612457565b95989497509550505050565b6000806040838503121561251957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6004811061255c57634e487b7160e01b600052602160045260246000fd5b9052565b602080825282518282018190526000919060409081850190868401855b8281101561260e57815180516001600160a01b03908116865287820151151588870152868201511686860152606080820151908601526080808201519086015260a0808201519086015260c0808201519086015260e0808201516125e38288018261253e565b505061010081810151908601526101209081015190850152610140909301929085019060010161257d565b5091979650505050505050565b8015158114611afa57600080fd5b600080600080600060a0868803121561264157600080fd5b61264a86612351565b945061265860208701612351565b935060408601359250606086013561266f8161261b565b949793965091946080013592915050565b6000806020838503121561269357600080fd5b82356001600160401b038111156126a957600080fd5b6126b585828601612457565b90969095509350505050565b60008060008060008060008060a0898b0312156126dd57600080fd5b6126e689612351565b97506126f460208a01612351565b965060408901356001600160401b038082111561271057600080fd5b61271c8c838d01612457565b909850965060608b013591508082111561273557600080fd5b6127418c838d01612457565b909650945060808b013591508082111561275a57600080fd5b506127678b828c0161236d565b999c989b5096995094979396929594505050565b60008060008060008060c0878903121561279457600080fd5b61279d87612351565b9550602087013594506127b260408801612351565b93506060870135925060808701356127c98161261b565b8092505060a087013590509295509295509295565b60008060008060008060008060008060008060c08d8f03121561280057600080fd5b6001600160401b038d35111561281557600080fd5b6128228e8e358f01612457565b909c509a506001600160401b0360208e0135111561283f57600080fd5b61284f8e60208f01358f01612457565b909a5098506001600160401b0360408e0135111561286c57600080fd5b61287c8e60408f01358f01612457565b90985096506001600160401b0360608e0135111561289957600080fd5b6128a98e60608f01358f01612457565b90965094506001600160401b0360808e013511156128c657600080fd5b6128d68e60808f01358f01612457565b90945092506001600160401b0360a08e013511156128f357600080fd5b6129038e60a08f01358f01612457565b81935080925050509295989b509295989b509295989b565b60008060006060848603121561293057600080fd5b61293984612351565b95602085013595506040909401359392505050565b6000806040838503121561296157600080fd5b8235915061297160208401612351565b90509250929050565b6001600160a01b038b811682528a1515602083015289166040820152606081018890526080810187905260a0810186905260c0810185905261014081016129c460e083018661253e565b610100820193909352610120015298975050505050505050565b60008060008060008060a087890312156129f757600080fd5b612a0087612351565b9550612a0e60208801612351565b9450604087013593506060870135925060808701356001600160401b03811115612a3757600080fd5b612a4389828a0161236d565b979a9699509497509295939492505050565b600060208284031215612a6757600080fd5b8151611ba88161261b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208101610651828461253e565b634e487b7160e01b600052601160045260246000fd5b600081612ada57612ada612ab5565b506000190190565b634e487b7160e01b600052603260045260246000fd5b60008219821115612b0b57612b0b612ab5565b500190565b634e487b7160e01b600052604160045260246000fd5b6000600019821415612b3a57612b3a612ab5565b5060010190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a0608082018190526003908201526203078360ec1b60c082015260e00190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215612bbb57600080fd5b8135611ba88161261b565b600082821015612bd857612bd8612ab5565b500390565b6000816000190483118215151615612bf757612bf7612ab5565b500290565b600082612c1957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b6000825160005b81811015612c555760208186018101518583015201612c3b565b81811115612c64576000828501525b50919091019291505056fea2646970667358221220d136dbe86eb67037fc71554b026286e66584ae572f621b613c87c3cdd2f2b47064736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (200 runs)
IERC1155.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol) pragma solidity ^0.8.0; import "../token/ERC1155/IERC1155.sol";
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// 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);
}
IERC721.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721.sol";
IERC721Receiver.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721Receiver.sol";
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_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);
}
}
IERC1155Receiver.sol 58 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
IERC1155Receiver.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../token/ERC1155/IERC1155Receiver.sol";
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
AssemblyCurated_v1.sol 633 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/interfaces/IERC1155.sol";
import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol";
import "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./utils/TransferHelper.sol";
contract AssemblyCurated is
ReentrancyGuard,
Ownable,
IERC721Receiver,
IERC1155Receiver
{
enum LotStatus {
Inactive,
Active,
Successful,
Canceled
}
struct Lot {
address token;
bool is1155; // true - erc1155, false - erc721
address owner;
uint256 tokenId;
uint256 price;
uint256 lotStart;
uint256 lotEnd;
LotStatus status;
uint256 totalSupply; // 0 - erc721
uint256 sold;
}
event NewLot(
uint256 indexed lotId,
uint256 indexed tokenId,
address indexed token,
address owner,
uint256 totalSupply
);
event SellLot(
uint256 indexed lotId,
uint256 indexed tokenId,
address indexed token,
address buyer,
uint256 amount,
uint256 price
);
event CancelLot(uint256 indexed lotId);
event DeactivateLot(uint256 indexed lotId);
event ActivateLot(uint256 indexed lotId);
event CloseLot(uint256 indexed lotId);
event UpdateRecipient(address newRecipient);
event SetAllowedCaller(address caller, bool isAllowed);
event RescueToken(
address to,
address token,
uint256 tokenId,
bool is1155,
uint256 amount
);
///@notice - return when one of parameters is zero address
error ZeroAddress();
///@notice - only allowedCaller
error OnlyAllowedCaller();
///@notice - token is not support ERC721 or ERC1155 interface
error InvalidToken();
///@notice - lot with the same token and tokenID already exists.
error LotAlreadyExists();
///@notice - array lengths do not match
error WrongArrayLength();
///@notice - the lot has an incorrect status, so the operation cannot be performed.
/// records the actual status of the lot
error InvalidLotStatus(LotStatus actualStatus);
///@notice - not enough eth
error InvalidValue();
///@notice - amount equal to zero or less than the amount of tokens available in the lot
error InvalidAmount();
///@notice - allowedCaller already added or removed
error AlreadySet();
address public recipient;
uint256 public lastLotId;
uint256 public activeLotCount;
mapping(uint256 => Lot) public lots;
mapping(address => mapping(uint256 => uint256[])) public tokenLots;
mapping(address => bool) public allowedCallers;
mapping(address => mapping(uint256 => bool)) private existingTokens;
EnumerableSet.UintSet private activeLots;
constructor(
address _recipient,
address[] memory _allowedCallers,
address _owner
) payable {
if (_recipient == address(0)) {
revert ZeroAddress();
}
recipient = _recipient;
uint256 length = _allowedCallers.length;
for (uint256 i; i < length; ) {
if (_allowedCallers[i] == address(0)) {
revert ZeroAddress();
}
allowedCallers[_allowedCallers[i]] = true;
unchecked {
++i;
}
}
if (_owner != address(0)) {
_transferOwnership(_owner);
}
}
modifier onlyAllowedCaller() {
if (!allowedCallers[msg.sender]) {
revert OnlyAllowedCaller();
}
_;
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165)
returns (bool)
{
return
interfaceId == type(IERC1155Receiver).interfaceId ||
interfaceId == type(IERC165).interfaceId;
}
function onERC1155Received(
address _operator,
address _from,
uint256 _id,
uint256 _value,
bytes calldata _data
) external pure override returns (bytes4) {
// return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"));
return 0xf23a6e61;
}
function onERC1155BatchReceived(
address _operator,
address _from,
uint256[] calldata _ids,
uint256[] calldata _values,
bytes calldata _data
) external pure override returns (bytes4) {
// return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"));
return 0xbc197c81;
}
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external pure override returns (bytes4) {
// return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
return 0x150b7a02;
}
/// @notice Transfer token to contract and create new lot
/// @dev prior approve from owner of token is required.
/// @param token - address of NFT collection
/// @param tokenId - target token id
/// @param owner - current owner of token
/// @param price - price in wei
/// @param is1155 - is ERC1155 token?
/// @param amount - amount of ERC1155 token. For ERC721 can be 0
/// @return lotId - id of new lot
function createLot(
address token,
uint256 tokenId,
address owner,
uint256 price,
bool is1155,
uint256 amount
) public onlyAllowedCaller returns (uint256) {
if (!isSupportedToken(token)) {
revert InvalidToken();
}
if (doesLotExist(token, tokenId)) {
revert LotAlreadyExists();
}
if (is1155) {
if (amount == 0) {
revert InvalidAmount();
}
IERC1155(token).safeTransferFrom(
owner,
address(this),
tokenId,
amount,
"0x0"
);
} else {
IERC721(token).safeTransferFrom(owner, address(this), tokenId);
}
uint256 lotId = ++lastLotId;
lots[lotId].tokenId = tokenId;
lots[lotId].token = token;
lots[lotId].price = price;
lots[lotId].lotStart = block.timestamp;
lots[lotId].owner = owner;
lots[lotId].status = LotStatus.Active;
lots[lotId].is1155 = is1155;
if (is1155) lots[lotId].totalSupply = amount;
tokenLots[token][tokenId].push(lotId);
EnumerableSet.add(activeLots, lotId);
existingTokens[token][tokenId] = true;
activeLotCount++;
emit NewLot(lotId, tokenId, token, owner, amount);
return lotId;
}
/// @notice multiple creation of lots
/// @param tokens - addresses of NFT collection
/// @param tokenIds - target token ids
/// @param owners - current owners of tokens
/// @param prices - prices in wei
/// @param is1155s - is ERC1155 tokens?
/// @param amounts - amounts of ERC1155 tokens
function batchCreateLots(
address[] calldata tokens,
uint256[] calldata tokenIds,
address[] calldata owners,
uint256[] calldata prices,
bool[] calldata is1155s,
uint256[] calldata amounts
) external onlyAllowedCaller {
uint256 length = tokens.length;
if (
length != tokenIds.length ||
length != owners.length ||
length != prices.length ||
length != is1155s.length ||
length != amounts.length
) {
revert WrongArrayLength();
}
for (uint256 i; i < length; ) {
createLot(
tokens[i],
tokenIds[i],
owners[i],
prices[i],
is1155s[i],
amounts[i]
);
unchecked {
++i;
}
}
}
///@notice Buy active lot
///@param lotId - id of target lot
///@param amount - amount for ERC1155 token
function buyLot(uint256 lotId, uint256 amount) public payable nonReentrant {
Lot memory localLot = lots[lotId];
if (localLot.status != LotStatus.Active) {
revert InvalidLotStatus(localLot.status);
}
if (localLot.is1155) {
_buyMultipleLot(lotId, localLot, amount);
} else {
_buySingleLot(lotId, localLot);
}
}
///@notice Cancel lot and send token to target recipient
///@dev For transfer to primary owner set newRecipient = address(0)
///@param lotId - id of target lot
///@param newRecipient - address of the recipient of the canceled token
function cancelLot(uint256 lotId, address newRecipient) public onlyOwner {
Lot memory localLot = lots[lotId];
if (
localLot.status != LotStatus.Active &&
!(localLot.status == LotStatus.Inactive && localLot.lotStart != 0)
) {
revert InvalidLotStatus(localLot.status);
}
address finalRecipient = newRecipient != address(0)
? newRecipient
: localLot.owner;
if (localLot.is1155) {
IERC1155(localLot.token).safeTransferFrom(
address(this),
finalRecipient,
localLot.tokenId,
localLot.totalSupply - localLot.sold,
"0x0"
);
} else {
IERC721(localLot.token).safeTransferFrom(
address(this),
finalRecipient,
localLot.tokenId
);
}
lots[lotId].status = LotStatus.Canceled;
lots[lotId].lotEnd = block.timestamp;
activeLotCount--;
EnumerableSet.remove(activeLots, lotId);
existingTokens[localLot.token][localLot.tokenId] = false;
emit CancelLot(lotId);
}
///@notice multiple canceling of lots
///@param lotIds - ids of target lots
///@param newRecipients - addresses of the recipients of the canceled tokens
function batchCancelLots(
uint256[] calldata lotIds,
address[] calldata newRecipients
) external onlyOwner {
uint256 length = lotIds.length;
if (length != newRecipients.length) {
revert WrongArrayLength();
}
for (uint256 i; i < length; ) {
cancelLot(lotIds[i], newRecipients[i]);
unchecked {
++i;
}
}
}
///@notice Deactivate lot, but the token remains
///@param lotId - id of target lot
function deactivateLot(uint256 lotId) public onlyOwner {
Lot memory localLot = lots[lotId];
if (localLot.status != LotStatus.Active) {
revert InvalidLotStatus(localLot.status);
}
lots[lotId].status = LotStatus.Inactive;
activeLotCount--;
EnumerableSet.remove(activeLots, lotId);
emit DeactivateLot(lotId);
}
/// @notice multiple deactivating of lots
///@param lotIds - ids of target lots
function batchDeactivateLots(uint256[] calldata lotIds) external onlyOwner {
uint256 length = lotIds.length;
for (uint256 i; i < length; ) {
deactivateLot(lotIds[i]);
unchecked {
++i;
}
}
}
///@notice Activation of a previously deactivated lot
///@param lotId - id of target lot
function activateLot(uint256 lotId) public onlyOwner {
Lot memory localLot = lots[lotId];
if (localLot.status != LotStatus.Inactive && localLot.lotStart != 0) {
revert InvalidLotStatus(localLot.status);
}
lots[lotId].status = LotStatus.Active;
activeLotCount++;
EnumerableSet.add(activeLots, lotId);
emit ActivateLot(lotId);
}
///@notice multiple activating of lots
///@param lotIds - ids of target lots
function batchActivateLots(uint256[] calldata lotIds) external onlyOwner {
uint256 length = lotIds.length;
for (uint256 i; i < length; ) {
activateLot(lotIds[i]);
unchecked {
++i;
}
}
}
///@notice Return list of active lots
///@dev If count > of active lots count, then will be returned empty Lot structures
///@param start - offset
///@param count - limit
function getActiveLots(uint256 start, uint256 count)
external
view
returns (Lot[] memory lotsData)
{
uint256 end = EnumerableSet.length(activeLots);
if (start + count < end) {
end = start + count;
}
Lot memory lot;
uint256 idx;
lotsData = new Lot[](count);
for (uint256 i = start; i < end; ) {
lot = lots[EnumerableSet.at(activeLots, i)];
lotsData[idx++] = lot;
unchecked {
++i;
}
}
}
///@notice Checks if the token supports the ERC721 or ERC1155 interface
///@param token - address of target roken
function isSupportedToken(address token) public view returns (bool) {
return
IERC165(token).supportsInterface(0x80ac58cd) ||
IERC165(token).supportsInterface(0xd9b67a26);
}
///@notice checking if a lot exists with the specified token
/// @param token - address of NFT collection
/// @param tokenId - target token id
function doesLotExist(address token, uint256 tokenId)
private
view
returns (bool)
{
return existingTokens[token][tokenId];
}
///@notice - buy lot with ERC721 token
///@param lotId - id of target lot
///@param localLot - target lot structure
function _buySingleLot(uint256 lotId, Lot memory localLot) private {
if (localLot.price > msg.value) {
revert InvalidValue();
}
IERC721(localLot.token).safeTransferFrom(
address(this),
msg.sender,
localLot.tokenId
);
uint256 ownerValue = (localLot.price * 80) / 100;
TransferHelper.safeTransferETH(localLot.owner, ownerValue);
TransferHelper.safeTransferETH(recipient, localLot.price - ownerValue);
// refund dust eth, if any
if (msg.value > localLot.price)
TransferHelper.safeTransferETH(
msg.sender,
msg.value - localLot.price
);
lots[lotId].status = LotStatus.Successful;
lots[lotId].lotEnd = block.timestamp;
activeLotCount--;
EnumerableSet.remove(activeLots, lotId);
existingTokens[localLot.token][localLot.tokenId] = false;
emit CloseLot(lotId);
emit SellLot(
lotId,
localLot.tokenId,
localLot.token,
msg.sender,
0,
localLot.price
);
}
///@notice - buy lot with ERC1155 token
///@param lotId - id of target lot
///@param localLot - target lot structure
function _buyMultipleLot(
uint256 lotId,
Lot memory localLot,
uint256 amount
) private {
if (amount == 0 || amount > localLot.totalSupply - localLot.sold) {
revert InvalidAmount();
}
uint256 totalPrice = amount * localLot.price;
if (totalPrice > msg.value) {
revert InvalidValue();
}
IERC1155(localLot.token).safeTransferFrom(
address(this),
msg.sender,
localLot.tokenId,
amount,
"0x0"
);
uint256 ownerValue = (totalPrice * 80) / 100;
TransferHelper.safeTransferETH(localLot.owner, ownerValue);
TransferHelper.safeTransferETH(recipient, totalPrice - ownerValue);
// refund dust eth, if any
if (msg.value > totalPrice)
TransferHelper.safeTransferETH(msg.sender, msg.value - totalPrice);
lots[lotId].sold += amount;
if (localLot.sold + amount == localLot.totalSupply) {
lots[lotId].status = LotStatus.Successful;
lots[lotId].lotEnd = block.timestamp;
activeLotCount--;
EnumerableSet.remove(activeLots, lotId);
existingTokens[localLot.token][localLot.tokenId] = false;
emit CloseLot(lotId);
}
emit SellLot(
lotId,
localLot.tokenId,
localLot.token,
msg.sender,
amount,
localLot.price
);
}
/* --- OWNER --- */
///@notice - set new marketplace recipient address
///@param newRecipient - recipient address
function updateRecipient(address newRecipient) external onlyOwner {
if (newRecipient == address(0)) {
revert ZeroAddress();
}
recipient = newRecipient;
emit UpdateRecipient(newRecipient);
}
///@notice - adding a new allowedCaller
///@param caller - allowedCaller address
function addAllowedCaller(address caller) external onlyOwner {
if (caller == address(0)) {
revert ZeroAddress();
}
if (allowedCallers[caller]) {
revert AlreadySet();
}
allowedCallers[caller] = true;
emit SetAllowedCaller(caller, true);
}
///@notice - removing allowedCaller
///@param caller - allowedCaller address
function removeAllowedCaller(address caller) external onlyOwner {
if (!allowedCallers[caller]) {
revert AlreadySet();
}
allowedCallers[caller] = false;
emit SetAllowedCaller(caller, false);
}
///@notice transfer NFT token from contract
///@dev Not recommended for use with existing lots as it does not change the status of the lot.
///To withdraw a token from an existing lot, use cancelLot
///@param to - NFT token recipient
///@param token - address of NFT collection
///@param tokenId - id of NFT token
///@param is1155 - is token ERC115?
///@param amount - token amount for ERC1155
function rescue(
address to,
address token,
uint256 tokenId,
bool is1155,
uint256 amount
) external onlyOwner {
if (to == address(0)) {
revert ZeroAddress();
}
if (is1155) {
if (amount == 0) {
revert InvalidAmount();
}
IERC1155(token).safeTransferFrom(
address(this),
to,
tokenId,
amount,
"0x0"
);
} else {
IERC721(token).safeTransferFrom(address(this), to, tokenId);
}
emit RescueToken(to, token, tokenId, is1155, amount);
}
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
EnumerableSet.sol 357 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
TransferHelper.sol 10 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
library TransferHelper {
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, "TransferHelper: Transfer failed eth");
}
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
Read Contract
activeLotCount 0x2590f55b → uint256
allowedCallers 0x7b334154 → bool
getActiveLots 0x4022d7d2 → tuple[]
isSupportedToken 0x240028e8 → bool
lastLotId 0x6a52bd45 → uint256
lots 0xf1648e84 → address, bool, address, uint256, uint256, uint256, uint256, uint8, uint256, uint256
onERC1155BatchReceived 0xbc197c81 → bytes4
onERC1155Received 0xf23a6e61 → bytes4
onERC721Received 0x150b7a02 → bytes4
owner 0x8da5cb5b → address
recipient 0x66d003ac → address
supportsInterface 0x01ffc9a7 → bool
tokenLots 0xd4a8a09e → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
activateLot 0x60ba6fe2
uint256 lotId
addAllowedCaller 0x613a7b48
address caller
batchActivateLots 0x70ab51ef
uint256[] lotIds
batchCancelLots 0x3abe3d86
uint256[] lotIds
address[] newRecipients
batchCreateLots 0xd34e9584
address[] tokens
uint256[] tokenIds
address[] owners
uint256[] prices
bool[] is1155s
uint256[] amounts
batchDeactivateLots 0xa4d611bb
uint256[] lotIds
buyLot 0xb32fdcea
uint256 lotId
uint256 amount
cancelLot 0xed54be2b
uint256 lotId
address newRecipient
createLot 0xcc46740f
address token
uint256 tokenId
address owner
uint256 price
bool is1155
uint256 amount
returns: uint256
deactivateLot 0x38587833
uint256 lotId
removeAllowedCaller 0x9546f95e
address caller
renounceOwnership 0x715018a6
No parameters
rescue 0x524cef5d
address to
address token
uint256 tokenId
bool is1155
uint256 amount
transferOwnership 0xf2fde38b
address newOwner
updateRecipient 0xfeec756c
address newRecipient
Recent Transactions
No transactions found for this address