@sharkpunks/contracts
Version:
[](http://www.wtfpl.net/)
274 lines • 21.8 kB
JSON
{
"address": "0x293Ae5226D3Bda6969348D8b211A73Ad7Cafb7Ea",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Receive",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "isOperator",
"type": "bool"
}
],
"name": "SetOperator",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "Withdraw",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "isOperator",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "bool",
"name": "_isOperator",
"type": "bool"
}
],
"name": "setOperator",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"transactionHash": "0x44c124f0b5b4dd9b93acf3b318e336f91a506c9d621d5e54eb58bfd18c1d163d",
"receipt": {
"to": null,
"from": "0x5b8C253517b6Bd003369173109693B01cb6841B5",
"contractAddress": "0x293Ae5226D3Bda6969348D8b211A73Ad7Cafb7Ea",
"transactionIndex": 347,
"gasUsed": "357001",
"logsBloom": "0x00000080000000000100000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000001000000000010000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x950093b6f47f1b0e70586e09ac86a56b39905919cbe7fdb493c01d8422595a01",
"transactionHash": "0x44c124f0b5b4dd9b93acf3b318e336f91a506c9d621d5e54eb58bfd18c1d163d",
"logs": [
{
"transactionIndex": 347,
"blockNumber": 14811411,
"transactionHash": "0x44c124f0b5b4dd9b93acf3b318e336f91a506c9d621d5e54eb58bfd18c1d163d",
"address": "0x293Ae5226D3Bda6969348D8b211A73Ad7Cafb7Ea",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000005b8c253517b6bd003369173109693b01cb6841b5"
],
"data": "0x",
"logIndex": 466,
"blockHash": "0x950093b6f47f1b0e70586e09ac86a56b39905919cbe7fdb493c01d8422595a01"
}
],
"blockNumber": 14811411,
"cumulativeGasUsed": "22917306",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "79241549d2b1e10d2c06ca9cef40e88c",
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Receive\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isOperator\",\"type\":\"bool\"}],\"name\":\"SetOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_isOperator\",\"type\":\"bool\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ETHVault.sol\":\"ETHVault\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x00000000d41867734bbee4c6863d9255b2b06ac1\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/ETHVault.sol\":{\"content\":\"// SPDX-License-Identifier: WTFPL\\n\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./interfaces/IETHVault.sol\\\";\\n\\ncontract ETHVault is Ownable, IETHVault {\\n mapping(address => bool) public override isOperator;\\n\\n receive() external payable {\\n emit Receive(msg.sender, msg.value);\\n }\\n\\n function setOperator(address account, bool _isOperator) external override onlyOwner {\\n isOperator[account] = _isOperator;\\n\\n emit SetOperator(account, _isOperator);\\n }\\n\\n function withdraw(uint256 amount, address to) external override {\\n require(isOperator[msg.sender], \\\"EV: FORBIDDEN\\\");\\n\\n emit Withdraw(msg.sender, amount, to);\\n\\n payable(to).transfer(amount);\\n }\\n}\\n\",\"keccak256\":\"0x1cd1243fef100f60cc2ff189fd8749484716e3fd9e6a5348829cf054fc75e8b4\",\"license\":\"WTFPL\"},\"contracts/interfaces/IETHVault.sol\":{\"content\":\"// SPDX-License-Identifier: WTFPL\\n\\npragma solidity >=0.5.0;\\n\\ninterface IETHVault {\\n event Receive(address indexed sender, uint256 amount);\\n event SetOperator(address indexed account, bool isOperator);\\n event Withdraw(address indexed operator, uint256 amount, address to);\\n\\n function isOperator(address account) external view returns (bool);\\n\\n function setOperator(address account, bool _isOperator) external;\\n\\n function withdraw(uint256 amount, address to) external;\\n}\\n\",\"keccak256\":\"0x278e06a7a5879b4935e13f006b3103622dcd11af36bfce9c9917970d8d3a43f8\",\"license\":\"WTFPL\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61050a8061007e6000396000f3fe6080604052600436106100585760003560e01c8062f714ce14610099578063558a7297146100bb5780636d70f7ae146100db578063715018a6146101205780638da5cb5b14610135578063f2fde38b1461015d57600080fd5b366100945760405134815233907fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def39060200160405180910390a2005b600080fd5b3480156100a557600080fd5b506100b96100b4366004610415565b61017d565b005b3480156100c757600080fd5b506100b96100d6366004610441565b61024f565b3480156100e757600080fd5b5061010b6100f636600461047d565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561012c57600080fd5b506100b96102d8565b34801561014157600080fd5b506000546040516001600160a01b039091168152602001610117565b34801561016957600080fd5b506100b961017836600461047d565b61030e565b3360009081526001602052604090205460ff166101d15760405162461bcd60e51b815260206004820152600d60248201526c22ab1d102327a92124a22222a760991b60448201526064015b60405180910390fd5b604080518381526001600160a01b038316602082015233917f56c54ba9bd38d8fd62012e42c7ee564519b09763c426d331b3661b537ead19b2910160405180910390a26040516001600160a01b0382169083156108fc029084906000818181858888f1935050505015801561024a573d6000803e3d6000fd5b505050565b6000546001600160a01b031633146102795760405162461bcd60e51b81526004016101c89061049f565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f1618a22a3b00b9ac70fd5a82f1f5cdd8cb272bd0f1b740ddf7c26ab05881dd5b910160405180910390a25050565b6000546001600160a01b031633146103025760405162461bcd60e51b81526004016101c89061049f565b61030c60006103a9565b565b6000546001600160a01b031633146103385760405162461bcd60e51b81526004016101c89061049f565b6001600160a01b03811661039d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101c8565b6103a6816103a9565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461041057600080fd5b919050565b6000806040838503121561042857600080fd5b82359150610438602084016103f9565b90509250929050565b6000806040838503121561045457600080fd5b61045d836103f9565b91506020830135801515811461047257600080fd5b809150509250929050565b60006020828403121561048f57600080fd5b610498826103f9565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220cc5828a83eeb25f389fb84bf6bc5d6ba850cc925f1d1cc063e114d584d0ec1f064736f6c634300080d0033",
"deployedBytecode": "0x6080604052600436106100585760003560e01c8062f714ce14610099578063558a7297146100bb5780636d70f7ae146100db578063715018a6146101205780638da5cb5b14610135578063f2fde38b1461015d57600080fd5b366100945760405134815233907fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def39060200160405180910390a2005b600080fd5b3480156100a557600080fd5b506100b96100b4366004610415565b61017d565b005b3480156100c757600080fd5b506100b96100d6366004610441565b61024f565b3480156100e757600080fd5b5061010b6100f636600461047d565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561012c57600080fd5b506100b96102d8565b34801561014157600080fd5b506000546040516001600160a01b039091168152602001610117565b34801561016957600080fd5b506100b961017836600461047d565b61030e565b3360009081526001602052604090205460ff166101d15760405162461bcd60e51b815260206004820152600d60248201526c22ab1d102327a92124a22222a760991b60448201526064015b60405180910390fd5b604080518381526001600160a01b038316602082015233917f56c54ba9bd38d8fd62012e42c7ee564519b09763c426d331b3661b537ead19b2910160405180910390a26040516001600160a01b0382169083156108fc029084906000818181858888f1935050505015801561024a573d6000803e3d6000fd5b505050565b6000546001600160a01b031633146102795760405162461bcd60e51b81526004016101c89061049f565b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915591519182527f1618a22a3b00b9ac70fd5a82f1f5cdd8cb272bd0f1b740ddf7c26ab05881dd5b910160405180910390a25050565b6000546001600160a01b031633146103025760405162461bcd60e51b81526004016101c89061049f565b61030c60006103a9565b565b6000546001600160a01b031633146103385760405162461bcd60e51b81526004016101c89061049f565b6001600160a01b03811661039d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101c8565b6103a6816103a9565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461041057600080fd5b919050565b6000806040838503121561042857600080fd5b82359150610438602084016103f9565b90509250929050565b6000806040838503121561045457600080fd5b61045d836103f9565b91506020830135801515811461047257600080fd5b809150509250929050565b60006020828403121561048f57600080fd5b610498826103f9565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260408201526060019056fea2646970667358221220cc5828a83eeb25f389fb84bf6bc5d6ba850cc925f1d1cc063e114d584d0ec1f064736f6c634300080d0033",
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "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."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 7,
"contract": "contracts/ETHVault.sol:ETHVault",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 1700,
"contract": "contracts/ETHVault.sol:ETHVault",
"label": "isOperator",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_bool)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_bool)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => bool)",
"numberOfBytes": "32",
"value": "t_bool"
}
}
}
}