@ethsub/sol
Version:
ethsub contracts
1,064 lines • 299 kB
JSON
{
"contractName": "WETH9",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "src",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "guy",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "dst",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "src",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "dst",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "src",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
},
{
"inputs": [],
"name": "deposit",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "guy",
"type": "address"
},
{
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "dst",
"type": "address"
},
{
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "src",
"type": "address"
},
{
"internalType": "address",
"name": "dst",
"type": "address"
},
{
"internalType": "uint256",
"name": "wad",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/WETH9.sol\":\"WETH9\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/WETH9.sol\":{\"keccak256\":\"0x0a9f783fbceac8ef4e2d4a018cb3f9156e2f8bc0e481716c3d0c2fa085742fae\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://03fa76bc627ae26dba0ae572b86a4b7fb0db690148393d8277507eeca8701a2d\",\"dweb:/ipfs/QmUqfc3sG6ReW8t8fLB2tANHDFZNMWq5pCNpwtvvqMjsFZ\"]}},\"version\":1}",
"bytecode": "0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b5061010d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b5b808211156100f457600081556001016100f9565b6106fa8061011c6000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461021f57806370a082311461024a57806395d89b411461027d578063a9059cbb14610292578063d0e30db0146102cb578063dd62ed3e146102d3576100af565b806306fdde03146100b4578063095ea7b31461013e57806318160ddd1461018b57806323b872dd146101b25780632e1a7d4d146101f5576100af565b366100af576100ad61030e565b005b600080fd5b3480156100c057600080fd5b506100c961035d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014a57600080fd5b506101776004803603604081101561016157600080fd5b506001600160a01b0381351690602001356103eb565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610451565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600480360360608110156101d557600080fd5b506001600160a01b03813581169160208101359091169060400135610455565b34801561020157600080fd5b506100ad6004803603602081101561021857600080fd5b5035610589565b34801561022b57600080fd5b5061023461061e565b6040805160ff9092168252519081900360200190f35b34801561025657600080fd5b506101a06004803603602081101561026d57600080fd5b50356001600160a01b0316610627565b34801561028957600080fd5b506100c9610639565b34801561029e57600080fd5b50610177600480360360408110156102b557600080fd5b506001600160a01b038135169060200135610693565b6100ad61030e565b3480156102df57600080fd5b506101a0600480360360408110156102f657600080fd5b506001600160a01b03813581169160200135166106a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b6001600160a01b03831660009081526003602052604081205482111561047a57600080fd5b6001600160a01b03841633148015906104b857506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b15610518576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104ed57600080fd5b6001600160a01b03841660009081526004602090815260408083203384529091529020805483900390555b6001600160a01b03808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105a557600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156105e4573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103e35780601f106103b8576101008083540402835291602001916103e3565b60006106a0338484610455565b9392505050565b60046020908152600092835260408084209091529082529020548156fea2646970667358221220631c8b432c6a814126d00b3aa13e49b37ed65509935770e26da0e0b74dcf32fb64736f6c634300060c0033",
"deployedBytecode": "0x6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461021f57806370a082311461024a57806395d89b411461027d578063a9059cbb14610292578063d0e30db0146102cb578063dd62ed3e146102d3576100af565b806306fdde03146100b4578063095ea7b31461013e57806318160ddd1461018b57806323b872dd146101b25780632e1a7d4d146101f5576100af565b366100af576100ad61030e565b005b600080fd5b3480156100c057600080fd5b506100c961035d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101035781810151838201526020016100eb565b50505050905090810190601f1680156101305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014a57600080fd5b506101776004803603604081101561016157600080fd5b506001600160a01b0381351690602001356103eb565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610451565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600480360360608110156101d557600080fd5b506001600160a01b03813581169160208101359091169060400135610455565b34801561020157600080fd5b506100ad6004803603602081101561021857600080fd5b5035610589565b34801561022b57600080fd5b5061023461061e565b6040805160ff9092168252519081900360200190f35b34801561025657600080fd5b506101a06004803603602081101561026d57600080fd5b50356001600160a01b0316610627565b34801561028957600080fd5b506100c9610639565b34801561029e57600080fd5b50610177600480360360408110156102b557600080fd5b506001600160a01b038135169060200135610693565b6100ad61030e565b3480156102df57600080fd5b506101a0600480360360408110156102f657600080fd5b506001600160a01b03813581169160200135166106a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103e35780601f106103b8576101008083540402835291602001916103e3565b820191906000526020600020905b8154815290600101906020018083116103c657829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b6001600160a01b03831660009081526003602052604081205482111561047a57600080fd5b6001600160a01b03841633148015906104b857506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b15610518576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104ed57600080fd5b6001600160a01b03841660009081526004602090815260408083203384529091529020805483900390555b6001600160a01b03808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105a557600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156105e4573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103e35780601f106103b8576101008083540402835291602001916103e3565b60006106a0338484610455565b9392505050565b60046020908152600092835260408084209091529082529020548156fea2646970667358221220631c8b432c6a814126d00b3aa13e49b37ed65509935770e26da0e0b74dcf32fb64736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "88:40:43:-:0;67:1808;88:40;;67:1808;88:40;;;-1:-1:-1;;;88:40:43;;;;;;-1:-1:-1;;88:40:43;;:::i;:::-;-1:-1:-1;134:31:43;;;;;;;;;;;;;-1:-1:-1;;;134:31:43;;;;;;;;;;;;:::i;:::-;-1:-1:-1;171:27:43;;;-1:-1:-1;;171:27:43;196:2;171:27;;;67:1808;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;67:1808:43;;;-1:-1:-1;67:1808:43;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "67:1808:43:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;637:9;:7;:9::i;:::-;67:1808;;;;;88:40;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1103:177;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1103:177:43;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1002:95;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1413:460;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1413:460:43;;;;;;;;;;;;;;;;;:::i;793:203::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;793:203:43;;:::i;171:27::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;457:65;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;457:65:43;-1:-1:-1;;;;;457:65:43;;:::i;134:31::-;;;;;;;;;;;;;:::i;1286:121::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1286:121:43;;;;;;;;:::i;658:130::-;;;:::i;528:65::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;528:65:43;;;;;;;;;;:::i;658:130::-;712:10;702:21;;;;:9;:21;;;;;;;;;:34;;727:9;702:34;;;;;;751:30;;;;;;;;;;;;;;;;;658:130::o;88:40::-;;;;;;;;;;;;;;;-1:-1:-1;;88:40:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1103:177::-;1185:10;1159:4;1175:21;;;:9;:21;;;;;;;;-1:-1:-1;;;;;1175:26:43;;;;;;;;;;;:32;;;1222:30;;;;;;;1159:4;;1175:26;;1185:10;;1222:30;;;;;;;;-1:-1:-1;1269:4:43;1103:177;;;;:::o;1002:95::-;1069:21;1002:95;:::o;1413:460::-;-1:-1:-1;;;;;1531:14:43;;1503:4;1531:14;;;:9;:14;;;;;;:21;-1:-1:-1;1531:21:43;1523:30;;;;;;-1:-1:-1;;;;;1568:17:43;;1575:10;1568:17;;;;:59;;-1:-1:-1;;;;;;1589:14:43;;;;;;:9;:14;;;;;;;;1604:10;1589:26;;;;;;;;-1:-1:-1;;1589:38:43;;1568:59;1564:179;;;-1:-1:-1;;;;;1651:14:43;;;;;;:9;:14;;;;;;;;1666:10;1651:26;;;;;;;;:33;-1:-1:-1;1651:33:43;1643:42;;;;;;-1:-1:-1;;;;;1699:14:43;;;;;;:9;:14;;;;;;;;1714:10;1699:26;;;;;;;:33;;;;;;;1564:179;-1:-1:-1;;;;;1753:14:43;;;;;;;:9;:14;;;;;;;;:21;;;;;;;1784:14;;;;;;;;;;:21;;;;;;1821:23;;;;;;;1784:14;;1821:23;;;;;;;;;;;-1:-1:-1;1862:4:43;1413:460;;;;;:::o;793:203::-;856:10;846:21;;;;:9;:21;;;;;;:28;-1:-1:-1;846:28:43;838:37;;;;;;895:10;885:21;;;;:9;:21;;;;;;:28;;;;;;;923:24;;;;;;910:3;;923:24;;885:21;923:24;910:3;895:10;923:24;;;;;;;;;;;;;;;;;;;;-1:-1:-1;962:27:43;;;;;;;;973:10;;962:27;;;;;;;;;;793:203;:::o;171:27::-;;;;;;:::o;457:65::-;;;;;;;;;;;;;:::o;134:31::-;;;;;;;;;;;;;;;-1:-1:-1;;134:31:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1286:121;1343:4;1366:34;1379:10;1391:3;1396;1366:12;:34::i;:::-;1359:41;1286:121;-1:-1:-1;;;1286:121:43:o;528:65::-;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.6.12;\n\ncontract WETH9 {\n string public name = \"Wrapped Ether\";\n string public symbol = \"WETH\";\n uint8 public decimals = 18;\n\n event Approval(address indexed src, address indexed guy, uint wad);\n event Transfer(address indexed src, address indexed dst, uint wad);\n event Deposit(address indexed dst, uint wad);\n event Withdrawal(address indexed src, uint wad);\n\n mapping (address => uint) public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n\n receive() external payable {\n deposit();\n }\n function deposit() public payable {\n balanceOf[msg.sender] += msg.value;\n emit Deposit(msg.sender, msg.value);\n }\n function withdraw(uint wad) public {\n require(balanceOf[msg.sender] >= wad);\n balanceOf[msg.sender] -= wad;\n msg.sender.transfer(wad);\n emit Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() public view returns (uint) {\n return address(this).balance;\n }\n\n function approve(address guy, uint wad) public returns (bool) {\n allowance[msg.sender][guy] = wad;\n emit Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint wad) public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(address src, address dst, uint wad)\n public\n returns (bool)\n {\n require(balanceOf[src] >= wad);\n\n if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {\n require(allowance[src][msg.sender] >= wad);\n allowance[src][msg.sender] -= wad;\n }\n\n balanceOf[src] -= wad;\n balanceOf[dst] += wad;\n\n emit Transfer(src, dst, wad);\n\n return true;\n }\n}\n",
"sourcePath": "/home/sigo/w/deer/ethsub/packages/sol/contracts/WETH9.sol",
"ast": {
"absolutePath": "project:/contracts/WETH9.sol",
"exportedSymbols": {
"WETH9": [
8483
]
},
"id": 8484,
"license": "LGPL-3.0-only",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8237,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "42:23:43"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 8483,
"linearizedBaseContracts": [
8483
],
"name": "WETH9",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "06fdde03",
"id": 8240,
"mutability": "mutable",
"name": "name",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8483,
"src": "88:40:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 8238,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "88:6:43",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "57726170706564204574686572",
"id": 8239,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "113:15:43",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_00cd3d46df44f2cbb950cf84eb2e92aa2ddd23195b1a009173ea59a063357ed3",
"typeString": "literal_string \"Wrapped Ether\""
},
"value": "Wrapped Ether"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "95d89b41",
"id": 8243,
"mutability": "mutable",
"name": "symbol",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8483,
"src": "134:31:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 8241,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "134:6:43",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"argumentTypes": null,
"hexValue": "57455448",
"id": 8242,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "159:6:43",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0f8a193ff464434486c0daf7db2a895884365d2bc84ba47a68fcf89c1b14b5b8",
"typeString": "literal_string \"WETH\""
},
"value": "WETH"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "313ce567",
"id": 8246,
"mutability": "mutable",
"name": "decimals",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8483,
"src": "171:27:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 8244,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "171:5:43",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3138",
"id": 8245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "196:2:43",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_18_by_1",
"typeString": "int_const 18"
},
"value": "18"
},
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 8254,
"name": "Approval",
"nodeType": "EventDefinition",
"parameters": {
"id": 8253,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8248,
"indexed": true,
"mutability": "mutable",
"name": "src",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8254,
"src": "221:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8247,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "221:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8250,
"indexed": true,
"mutability": "mutable",
"name": "guy",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8254,
"src": "242:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8249,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "242:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8252,
"indexed": false,
"mutability": "mutable",
"name": "wad",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8254,
"src": "263:8:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8251,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "263:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "220:52:43"
},
"src": "205:68:43"
},
{
"anonymous": false,
"documentation": null,
"id": 8262,
"name": "Transfer",
"nodeType": "EventDefinition",
"parameters": {
"id": 8261,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8256,
"indexed": true,
"mutability": "mutable",
"name": "src",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8262,
"src": "294:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8255,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "294:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8258,
"indexed": true,
"mutability": "mutable",
"name": "dst",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8262,
"src": "315:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8257,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "315:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8260,
"indexed": false,
"mutability": "mutable",
"name": "wad",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8262,
"src": "336:8:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8259,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "336:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "293:52:43"
},
"src": "278:68:43"
},
{
"anonymous": false,
"documentation": null,
"id": 8268,
"name": "Deposit",
"nodeType": "EventDefinition",
"parameters": {
"id": 8267,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8264,
"indexed": true,
"mutability": "mutable",
"name": "dst",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8268,
"src": "366:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8263,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "366:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8266,
"indexed": false,
"mutability": "mutable",
"name": "wad",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8268,
"src": "387:8:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8265,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "387:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "365:31:43"
},
"src": "351:46:43"
},
{
"anonymous": false,
"documentation": null,
"id": 8274,
"name": "Withdrawal",
"nodeType": "EventDefinition",
"parameters": {
"id": 8273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8270,
"indexed": true,
"mutability": "mutable",
"name": "src",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8274,
"src": "420:19:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8269,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "420:7:43",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8272,
"indexed": false,
"mutability": "mutable",
"name": "wad",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8274,
"src": "441:8:43",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8271,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "441:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "419:31:43"
},
"src": "402:49:43"
},
{
"constant": false,
"functionSelector": "70a08231",
"id": 8278,
"mutability": "mutable",
"name": "balanceOf",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8483,
"src": "457:65:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 8277,
"keyType": {
"id": 8275,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "466:7:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "457:25:43",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 8276,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "477:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "dd62ed3e",
"id": 8284,
"mutability": "mutable",
"name": "allowance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8483,
"src": "528:65:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
"typeString": "mapping(address => mapping(address => uint256))"
},
"typeName": {
"id": 8283,
"keyType": {
"id": 8279,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "537:7:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "528:46:43",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
"typeString": "mapping(address => mapping(address => uint256))"
},
"valueType": {
"id": 8282,
"keyType": {
"id": 8280,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "557:7:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "548:25:43",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 8281,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "568:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 8290,
"nodeType": "Block",
"src": "627:26:43",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8287,
"name": "deposit",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8310,
"src": "637:7:43",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 8288,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "637:9:43",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 8289,
"nodeType": "ExpressionStatement",
"src": "637:9:43"
}
]
},
"documentation": null,
"id": 8291,
"implemented": true,
"kind": "receive",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8285,
"nodeType": "ParameterList",
"parameters": [],
"src": "607:2:43"
},
"returnParameters": {
"id": 8286,
"nodeType": "ParameterList",
"parameters": [],
"src": "627:0:43"
},
"scope": 8483,
"src": "600:53:43",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"body": {
"id": 8309,
"nodeType": "Block",
"src": "692:96:43",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 8300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 8294,
"name": "balanceOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8278,
"src": "702:9:43",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 8297,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8295,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "712:3:43",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 8296,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "71