Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- ERC20TransferProxy
- Optimization enabled
- true
- Compiler version
- v0.7.6+commit.7338295f
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2024-02-09T13:54:48.234038Z
@rarible/transfer-proxy/contracts/proxy/ERC20TransferProxy.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.9 <0.8.0;import "@rarible/role-operator/contracts/OperatorRole.sol";import "@rarible/exchange-interfaces/contracts/IERC20TransferProxy.sol";contract ERC20TransferProxy is IERC20TransferProxy, Initializable, OperatorRole {function __ERC20TransferProxy_init() external initializer {__Ownable_init();}function erc20safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) override external onlyOperator {require(token.transferFrom(from, to, value), "failure while transferring");}}
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.0 <0.8.0;import "../utils/ContextUpgradeable.sol";import "../proxy/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {address private _owner;event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);/*** @dev Initializes the contract setting the deployer as the initial owner.*/function __Ownable_init() internal initializer {__Context_init_unchained();__Ownable_init_unchained();}function __Ownable_init_unchained() internal initializer {address msgSender = _msgSender();_owner = msgSender;emit OwnershipTransferred(address(0), msgSender);}/*** @dev Returns the address of the current owner.*/function owner() public view virtual returns (address) {
@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
// SPDX-License-Identifier: MIT// solhint-disable-next-line compiler-versionpragma solidity >=0.4.24 <0.8.0;import "../utils/AddressUpgradeable.sol";/*** @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.** TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as* possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.** CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.*/abstract contract Initializable {/*** @dev Indicates that the contract has been initialized.*/bool private _initialized;/*** @dev Indicates that the contract is in the process of being initialized.*/bool private _initializing;/*** @dev Modifier to protect an initializer function from being invoked twice.*/modifier initializer() {require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");bool isTopLevelCall = !_initializing;if (isTopLevelCall) {_initializing = true;_initialized = true;
@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.0 <0.8.0;/*** @dev Interface of the ERC20 standard as defined in the EIP.*/interface IERC20Upgradeable {/*** @dev Returns the amount of tokens in existence.*/function totalSupply() external view returns (uint256);/*** @dev Returns the amount of tokens owned by `account`.*/function balanceOf(address account) external view returns (uint256);/*** @dev Moves `amount` tokens from the caller's account to `recipient`.** Returns a boolean value indicating whether the operation succeeded.** Emits a {Transfer} event.*/function transfer(address recipient, uint256 amount) external returns (bool);/*** @dev Returns the remaining number of tokens that `spender` will be* allowed to spend on behalf of `owner` through {transferFrom}. This is* zero by default.** This value changes when {approve} or {transferFrom} are called.*/function allowance(address owner, address spender) external view returns (uint256);/*** @dev Sets `amount` as the allowance of `spender` over the caller's tokens.** Returns a boolean value indicating whether the operation succeeded.*
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.2 <0.8.0;/*** @dev Collection of functions related to the address type*/library AddressUpgradeable {/*** @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* ====*/function isContract(address account) internal view returns (bool) {// This method relies on extcodesize, which returns 0 for contracts in// construction, since the code is only stored at the end of the// constructor execution.uint256 size;// solhint-disable-next-line no-inline-assemblyassembly { size := extcodesize(account) }return size > 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
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.0 <0.8.0;import "../proxy/Initializable.sol";/** @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 GSN 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 ContextUpgradeable is Initializable {function __Context_init() internal initializer {__Context_init_unchained();}function __Context_init_unchained() internal initializer {}function _msgSender() internal view virtual returns (address payable) {return msg.sender;}function _msgData() internal view virtual returns (bytes memory) {this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691return msg.data;}uint256[50] private __gap;}
@rarible/exchange-interfaces/contracts/IERC20TransferProxy.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.9 <0.8.0;pragma abicoder v2;import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";interface IERC20TransferProxy {function erc20safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) external;}
@rarible/role-operator/contracts/OperatorRole.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.9 <0.8.0;import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";contract OperatorRole is OwnableUpgradeable {mapping (address => bool) operators;function __OperatorRole_init() external initializer {__Context_init_unchained();__Ownable_init_unchained();}function addOperator(address operator) external onlyOwner {operators[operator] = true;}function removeOperator(address operator) external onlyOwner {operators[operator] = false;}modifier onlyOperator() {require(operators[_msgSender()], "OperatorRole: caller is not the operator");_;}}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul"}
Contract ABI
[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__ERC20TransferProxy_init","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__OperatorRole_init","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"erc20safeTransferFrom","inputs":[{"type":"address","name":"token","internalType":"contract IERC20Upgradeable"},{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061095c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e35780639870d7fe14610107578063ac8a584a1461012d578063f2fde38b1461015357610088565b80632ff26a0a1461008d578063715018a614610097578063759781271461009f578063776062c3146100a7575b600080fd5b610095610179565b005b61009561022b565b6100956102d7565b610095600480360360808110156100bd57600080fd5b506001600160a01b0381358116916020810135821691604082013516906060013561036c565b6100eb6104bb565b604080516001600160a01b039092168252519081900360200190f35b6100956004803603602081101561011d57600080fd5b50356001600160a01b03166104ca565b6100956004803603602081101561014357600080fd5b50356001600160a01b0316610550565b6100956004803603602081101561016957600080fd5b50356001600160a01b03166105d3565b600054610100900460ff168061019257506101926106d6565b806101a0575060005460ff16155b6101db5760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610206576000805460ff1961ff0019909116610100171660011790555b61020e6106e7565b610216610787565b8015610228576000805461ff00191690555b50565b610233610880565b6001600160a01b03166102446104bb565b6001600160a01b03161461028d576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b600054610100900460ff16806102f057506102f06106d6565b806102fe575060005460ff16155b6103395760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610364576000805460ff1961ff0019909116610100171660011790555b610216610179565b60656000610378610880565b6001600160a01b0316815260208101919091526040016000205460ff166103d05760405162461bcd60e51b81526004018080602001828103825260288152602001806108ff6028913960400191505060405180910390fd5b836001600160a01b03166323b872dd8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561043857600080fd5b505af115801561044c573d6000803e3d6000fd5b505050506040513d602081101561046257600080fd5b50516104b5576040805162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015290519081900360640190fd5b50505050565b6033546001600160a01b031690565b6104d2610880565b6001600160a01b03166104e36104bb565b6001600160a01b03161461052c576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152606560205260409020805460ff19166001179055565b610558610880565b6001600160a01b03166105696104bb565b6001600160a01b0316146105b2576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152606560205260409020805460ff19169055565b6105db610880565b6001600160a01b03166105ec6104bb565b6001600160a01b031614610635576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260040180806020018281038252602681526020018061088b6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006106e130610884565b15905090565b600054610100900460ff168061070057506107006106d6565b8061070e575060005460ff16155b6107495760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610216576000805460ff1961ff0019909116610100171660011790558015610228576000805461ff001916905550565b600054610100900460ff16806107a057506107a06106d6565b806107ae575060005460ff16155b6107e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610814576000805460ff1961ff0019909116610100171660011790555b600061081e610880565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610228576000805461ff001916905550565b3390565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724f70657261746f72526f6c653a2063616c6c6572206973206e6f7420746865206f70657261746f72a26469706673582212202973a98c7cda54d291a78bc2c1e7767938d5273d121da56e402b35febf3f882c64736f6c63430007060033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e35780639870d7fe14610107578063ac8a584a1461012d578063f2fde38b1461015357610088565b80632ff26a0a1461008d578063715018a614610097578063759781271461009f578063776062c3146100a7575b600080fd5b610095610179565b005b61009561022b565b6100956102d7565b610095600480360360808110156100bd57600080fd5b506001600160a01b0381358116916020810135821691604082013516906060013561036c565b6100eb6104bb565b604080516001600160a01b039092168252519081900360200190f35b6100956004803603602081101561011d57600080fd5b50356001600160a01b03166104ca565b6100956004803603602081101561014357600080fd5b50356001600160a01b0316610550565b6100956004803603602081101561016957600080fd5b50356001600160a01b03166105d3565b600054610100900460ff168061019257506101926106d6565b806101a0575060005460ff16155b6101db5760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610206576000805460ff1961ff0019909116610100171660011790555b61020e6106e7565b610216610787565b8015610228576000805461ff00191690555b50565b610233610880565b6001600160a01b03166102446104bb565b6001600160a01b03161461028d576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b600054610100900460ff16806102f057506102f06106d6565b806102fe575060005460ff16155b6103395760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610364576000805460ff1961ff0019909116610100171660011790555b610216610179565b60656000610378610880565b6001600160a01b0316815260208101919091526040016000205460ff166103d05760405162461bcd60e51b81526004018080602001828103825260288152602001806108ff6028913960400191505060405180910390fd5b836001600160a01b03166323b872dd8484846040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050602060405180830381600087803b15801561043857600080fd5b505af115801561044c573d6000803e3d6000fd5b505050506040513d602081101561046257600080fd5b50516104b5576040805162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015290519081900360640190fd5b50505050565b6033546001600160a01b031690565b6104d2610880565b6001600160a01b03166104e36104bb565b6001600160a01b03161461052c576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152606560205260409020805460ff19166001179055565b610558610880565b6001600160a01b03166105696104bb565b6001600160a01b0316146105b2576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152606560205260409020805460ff19169055565b6105db610880565b6001600160a01b03166105ec6104bb565b6001600160a01b031614610635576040805162461bcd60e51b815260206004820181905260248201526000805160206108df833981519152604482015290519081900360640190fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260040180806020018281038252602681526020018061088b6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60006106e130610884565b15905090565b600054610100900460ff168061070057506107006106d6565b8061070e575060005460ff16155b6107495760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610216576000805460ff1961ff0019909116610100171660011790558015610228576000805461ff001916905550565b600054610100900460ff16806107a057506107a06106d6565b806107ae575060005460ff16155b6107e95760405162461bcd60e51b815260040180806020018281038252602e8152602001806108b1602e913960400191505060405180910390fd5b600054610100900460ff16158015610814576000805460ff1961ff0019909116610100171660011790555b600061081e610880565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610228576000805461ff001916905550565b3390565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724f70657261746f72526f6c653a2063616c6c6572206973206e6f7420746865206f70657261746f72a26469706673582212202973a98c7cda54d291a78bc2c1e7767938d5273d121da56e402b35febf3f882c64736f6c63430007060033