UNPKG

@windfallswap/core

Version:

🎛 Core contracts for the Windfall Swap protocol

895 lines (894 loc) • 475 kB
{ "contractName": "WindfallERC20", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "constant": true, "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "nonces", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "permit", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/D/defi/windfall/windfallswap-core/contracts/WindfallERC20.sol\":\"WindfallERC20\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/D/defi/windfall/windfallswap-core/contracts/WindfallERC20.sol\":{\"keccak256\":\"0xfb2c32d281474e4eca771427cdffef4648c6daff173065b3f3ee0b8e87a75aca\",\"urls\":[\"bzz-raw://09d313434c00129def4a7e310358656ae029fc24f8ff102f9cd4911ecd250864\",\"dweb:/ipfs/QmVLPtD4czTibaCqWfBztkUXZGsbQQXLCb5Vr7UuL6HJKn\"]},\"/D/defi/windfall/windfallswap-core/contracts/interfaces/IWindfallERC20.sol\":{\"keccak256\":\"0x06afc5fea9d39231709b5310fe95db5c27fd15de90260931716b4d639ade4ec4\",\"urls\":[\"bzz-raw://e111bda21798a8da22d630780283b45d2fe33fa7be8e475311ca12b614c537bf\",\"dweb:/ipfs/QmNgtysfQsjWjbsD8FxaWYRCcEttUP64zn2EsjotQUorh7\"]},\"/D/defi/windfall/windfallswap-core/contracts/libraries/SafeMath.sol\":{\"keccak256\":\"0xb35283807a3600a1df7abff9d82a7f8b563711333cb769bb473ed7c9c5b80cb3\",\"urls\":[\"bzz-raw://76578c35c07b8447d0ab87d34b71a2c2ca6995b5888ab9f6127e822e3d3e6e8e\",\"dweb:/ipfs/QmVPaXWUbsXtVZoGaFg1DtcrRP9axX8XWJFy5jfJ9Mknkb\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040514690806052610b878239604080519182900360520182208282018252600883526715da5b9919985b1b60c21b6020938401528151808301835260018152603160f81b908401528151808401919091527f3a3937b2e42caee8ada41f64a1232e57666e5049b7027916581ced79ebb1f00c818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550610a9b806100ec6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c80633644e5151161008c57806395d89b411161006657806395d89b411461029f578063a9059cbb146102a7578063d505accf146102e0578063dd62ed3e14610340576100df565b80633644e5151461023157806370a08231146102395780637ecebe001461026c576100df565b806323b872dd116100bd57806323b872dd146101c857806330adf81f1461020b578063313ce56714610213576100df565b806306fdde03146100e4578063095ea7b31461016157806318160ddd146101ae575b600080fd5b6100ec61037b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012657818101518382015260200161010e565b50505050905090810190601f1680156101535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61019a6004803603604081101561017757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356103b4565b604080519115158252519081900360200190f35b6101b66103cb565b60408051918252519081900360200190f35b61019a600480360360608110156101de57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356103d1565b6101b66104b0565b61021b6104d4565b6040805160ff9092168252519081900360200190f35b6101b66104d9565b6101b66004803603602081101561024f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104df565b6101b66004803603602081101561028257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104f1565b6100ec610503565b61019a600480360360408110156102bd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561053c565b61033e600480360360e08110156102f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610549565b005b6101b66004803603604081101561035657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610815565b6040518060400160405280600881526020017f57696e6466616c6c00000000000000000000000000000000000000000000000081525081565b60006103c1338484610832565b5060015b92915050565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461049b5773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610469908363ffffffff6108a116565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b6104a6848484610913565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60016020526000908152604090205481565b60046020526000908152604090205481565b6040518060400160405280600381526020017f57464c000000000000000000000000000000000000000000000000000000000081525081565b60006103c1338484610913565b428410156105b857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f57696e6466616c6c3a2045585049524544000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015610719573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061079457508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6107ff57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f57696e6466616c6c3a20494e56414c49445f5349474e41545552450000000000604482015290519081900360640190fd5b61080a898989610832565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b808203828111156103c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054610949908263ffffffff6108a116565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220939093559084168152205461098b908263ffffffff6109f416565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b808201828110156103c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfea265627a7a72315820aebb65a12c706c0b7323ae61a0a76f57a668134537dae24e167d1b5b8fe1403b64736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80633644e5151161008c57806395d89b411161006657806395d89b411461029f578063a9059cbb146102a7578063d505accf146102e0578063dd62ed3e14610340576100df565b80633644e5151461023157806370a08231146102395780637ecebe001461026c576100df565b806323b872dd116100bd57806323b872dd146101c857806330adf81f1461020b578063313ce56714610213576100df565b806306fdde03146100e4578063095ea7b31461016157806318160ddd146101ae575b600080fd5b6100ec61037b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012657818101518382015260200161010e565b50505050905090810190601f1680156101535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61019a6004803603604081101561017757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356103b4565b604080519115158252519081900360200190f35b6101b66103cb565b60408051918252519081900360200190f35b61019a600480360360608110156101de57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356103d1565b6101b66104b0565b61021b6104d4565b6040805160ff9092168252519081900360200190f35b6101b66104d9565b6101b66004803603602081101561024f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104df565b6101b66004803603602081101561028257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104f1565b6100ec610503565b61019a600480360360408110156102bd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561053c565b61033e600480360360e08110156102f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610549565b005b6101b66004803603604081101561035657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610815565b6040518060400160405280600881526020017f57696e6466616c6c00000000000000000000000000000000000000000000000081525081565b60006103c1338484610832565b5060015b92915050565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461049b5773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610469908363ffffffff6108a116565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b6104a6848484610913565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60016020526000908152604090205481565b60046020526000908152604090205481565b6040518060400160405280600381526020017f57464c000000000000000000000000000000000000000000000000000000000081525081565b60006103c1338484610913565b428410156105b857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f57696e6466616c6c3a2045585049524544000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015610719573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061079457508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6107ff57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f57696e6466616c6c3a20494e56414c49445f5349474e41545552450000000000604482015290519081900360640190fd5b61080a898989610832565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b808203828111156103c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054610949908263ffffffff6108a116565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220939093559084168152205461098b908263ffffffff6109f416565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b808201828110156103c557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfea265627a7a72315820aebb65a12c706c0b7323ae61a0a76f57a668134537dae24e167d1b5b8fe1403b64736f6c63430005100032", "sourceMap": "109:3408:1:-;;;934:458;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1124:95:1;;1024:7;;1124:95;;;;;;;;;;;;;;;;1254:4;;;;;;;;-1:-1:-1;;;1254:4:1;;;;;1289:10;;;;;;;;;;-1:-1:-1;;;1289:10:1;;;;1095:278;;;;;;;;;1238:22;1095:278;;;;1279:21;1095:278;;;;;;;;;;;1353:4;1095:278;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1095:278:1;;;;;;1071:313;;;;;;;;1052:16;:332;-1:-1:-1;109:3408:1;;;;;;", "deployedSourceMap": "109:3408:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;109:3408:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;189:40;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;189:40:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2231:147;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2231:147:1;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;322:24;;;:::i;:::-;;;;;;;;;;;;;;;;2533:301;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2533:301:1;;;;;;;;;;;;;;;;;;:::i;614:108::-;;;:::i;280:35::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;471:31;;;:::i;353:41::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;353:41:1;;;;:::i;729:38::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;729:38:1;;;;:::i;236:37::-;;;:::i;2386:139::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2386:139:1;;;;;;;;;:::i;2842:672::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;2842:672:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;401:61;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;401:61:1;;;;;;;;;;;:::i;189:40::-;;;;;;;;;;;;;;;;;;;:::o;2231:147::-;2295:4;2312:36;2321:10;2333:7;2342:5;2312:8;:36::i;:::-;-1:-1:-1;2366:4:1;2231:147;;;;;:::o;322:24::-;;;;:::o;2533:301::-;2632:15;;;2611:4;2632:15;;;:9;:15;;;;;;;;2648:10;2632:27;;;;;;;;2668:2;2632:39;2628:140;;2718:15;;;;;;;:9;:15;;;;;;;;2734:10;2718:27;;;;;;;;:38;;2750:5;2718:38;:31;:38;:::i;:::-;2688:15;;;;;;;:9;:15;;;;;;;;2704:10;2688:27;;;;;;;:68;2628:140;2778:26;2788:4;2794:2;2798:5;2778:9;:26::i;:::-;-1:-1:-1;2822:4:1;2533:301;;;;;:::o;614:108::-;656:66;614:108;:::o;280:35::-;313:2;280:35;:::o;471:31::-;;;;:::o;353:41::-;;;;;;;;;;;;;:::o;729:38::-;;;;;;;;;;;;;:::o;236:37::-;;;;;;;;;;;;;;;;;;;:::o;2386:139::-;2446:4;2463:32;2473:10;2485:2;2489:5;2463:9;:32::i;2842:672::-;2988:15;2976:8;:27;;2968:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3141:16;;3237:13;;;;3036:14;3237:13;;;:6;:13;;;;;;;;:15;;;;;;;;;3186:77;;656:66;3186:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;3186:77:1;;;;;3176:88;;;;;;3077:202;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;3077:202:1;;;;;;3053:237;;;;;;;;;3328:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3036:14;;3237:15;3328:26;;;;;-1:-1:-1;3328:26:1;;;;;;;;;;3237:15;3328:26;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;3328:26:1;;;;;;-1:-1:-1;;3373:30:1;;;;;;;:59;;;3427:5;3407:25;;:16;:25;;;3373:59;3365:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3475:31;3484:5;3491:7;3500:5;3475:8;:31::i;:::-;2842:672;;;;;;;;;:::o;401:61::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;1826:169::-;1907:16;;;;;;;;:9;:16;;;;;;;;:25;;;;;;;;;;;;;:33;;;1956:31;;;;;;;;;;;;;;;;;1826:169;;;:::o;296:129:10:-;380:5;;;375:16;;;;367:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2003:220:1;2097:15;;;;;;;:9;:15;;;;;;:26;;2117:5;2097:26;:19;:26;:::i;:::-;2079:15;;;;;;;;:9;:15;;;;;;:44;;;;2150:13;;;;;;;:24;;2168:5;2150:24;:17;:24;:::i;:::-;2134:13;;;;;;;;:9;:13;;;;;;;;;:40;;;;2190:25;;;;;;;2134:13;;2190:25;;;;;;;;;;;;;2003:220;;;:::o;160:128:10:-;244:5;;;239:16;;;;231:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "source": "pragma solidity =0.5.16;\r\n\r\nimport './interfaces/IWindfallERC20.sol';\r\nimport './libraries/SafeMath.sol';\r\n\r\ncontract WindfallERC20 is IWindfallERC20 {\r\n using SafeMath for uint;\r\n\r\n string public constant name = 'Windfall';\r\n string public constant symbol = 'WFL';\r\n uint8 public constant decimals = 18;\r\n uint public totalSupply;\r\n mapping(address => uint) public balanceOf;\r\n mapping(address => mapping(address => uint)) public allowance;\r\n\r\n bytes32 public DOMAIN_SEPARATOR;\r\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\r\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\r\n mapping(address => uint) public nonces;\r\n\r\n event Approval(address indexed owner, address indexed spender, uint value);\r\n event Transfer(address indexed from, address indexed to, uint value);\r\n\r\n constructor() public {\r\n uint chainId;\r\n assembly {\r\n chainId := chainid\r\n }\r\n DOMAIN_SEPARATOR = keccak256(\r\n abi.encode(\r\n keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),\r\n keccak256(bytes(name)),\r\n keccak256(bytes('1')),\r\n chainId,\r\n address(this)\r\n )\r\n );\r\n }\r\n\r\n function _mint(address to, uint value) internal {\r\n totalSupply = totalSupply.add(value);\r\n balanceOf[to] = balanceOf[to].add(value);\r\n emit Transfer(address(0), to, value);\r\n }\r\n\r\n function _burn(address from, uint value) internal {\r\n balanceOf[from] = balanceOf[from].sub(value);\r\n totalSupply = totalSupply.sub(value);\r\n emit Transfer(from, address(0), value);\r\n }\r\n\r\n function _approve(address owner, address spender, uint value) private {\r\n allowance[owner][spender] = value;\r\n emit Approval(owner, spender, value);\r\n }\r\n\r\n function _transfer(address from, address to, uint value) private {\r\n balanceOf[from] = balanceOf[from].sub(value);\r\n balanceOf[to] = balanceOf[to].add(value);\r\n emit Transfer(from, to, value);\r\n }\r\n\r\n function approve(address spender, uint value) external returns (bool) {\r\n _approve(msg.sender, spender, value);\r\n return true;\r\n }\r\n\r\n function transfer(address to, uint value) external returns (bool) {\r\n _transfer(msg.sender, to, value);\r\n return true;\r\n }\r\n\r\n function transferFrom(address from, address to, uint value) external returns (bool) {\r\n if (allowance[from][msg.sender] != uint(-1)) {\r\n allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);\r\n }\r\n _transfer(from, to, value);\r\n return true;\r\n }\r\n\r\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {\r\n require(deadline >= block.timestamp, 'Windfall: EXPIRED');\r\n bytes32 digest = keccak256(\r\n abi.encodePacked(\r\n '\\x19\\x01',\r\n DOMAIN_SEPARATOR,\r\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\r\n )\r\n );\r\n address recoveredAddress = ecrecover(digest, v, r, s);\r\n require(recoveredAddress != address(0) && recoveredAddress == owner, 'Windfall: INVALID_SIGNATURE');\r\n _approve(owner, spender, value);\r\n }\r\n}\r\n", "sourcePath": "D:\\defi\\windfall\\windfallswap-core\\contracts\\WindfallERC20.sol", "ast": { "absolutePath": "/D/defi/windfall/windfallswap-core/contracts/WindfallERC20.sol", "exportedSymbols": { "WindfallERC20": [ 417 ] }, "id": 418, "nodeType": "SourceUnit", "nodes": [ { "id": 34, "literals": [ "solidity", "=", "0.5", ".16" ], "nodeType": "PragmaDirective", "src": "0:24:1" }, { "absolutePath": "/D/defi/windfall/windfallswap-core/contracts/interfaces/IWindfallERC20.sol", "file": "./interfaces/IWindfallERC20.sol", "id": 35, "nodeType": "ImportDirective", "scope": 418, "sourceUnit": 1870, "src": "28:41:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/D/defi/windfall/windfallswap-core/contracts/libraries/SafeMath.sol", "file": "./libraries/SafeMath.sol", "id": 36, "nodeType": "ImportDirective", "scope": 418, "sourceUnit": 2326, "src": "71:34:1", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 37, "name": "IWindfallERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1869, "src": "135:14:1", "typeDescriptions": { "typeIdentifier": "t_contract$_IWindfallERC20_$1869", "typeString": "contract IWindfallERC20" } }, "id": 38, "nodeType": "InheritanceSpecifier", "src": "135:14:1" } ], "contractDependencies": [ 1869 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 417, "linearizedBaseContracts": [ 417, 1869 ], "name": "WindfallERC20", "nodeType": "ContractDefinition", "nodes": [ { "id": 41, "libraryName": { "contractScope": null, "id": 39, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2325, "src": "163:8:1", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$2325", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "157:24:1", "typeName": { "id": 40, "name": "uint", "nodeType": "ElementaryTypeName", "src": "176:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": true, "id": 44, "name": "name", "nodeType": "VariableDeclaration", "scope": 417, "src": "189:40:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 42, "name": "string", "nodeType": "ElementaryTypeName", "src": "189:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "57696e6466616c6c", "id": 43, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "219:10:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_3a3937b2e42caee8ada41f64a1232e57666e5049b7027916581ced79ebb1f00c", "typeString": "literal_string \"Windfall\"" }, "value": "Windfall" }, "visibility": "public" }, { "constant": true, "id": 47, "name": "symbol", "nodeType": "VariableDeclaration", "scope": 417, "src": "236:37:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string" }, "typeName": { "id": 45, "name": "string", "nodeType": "ElementaryTypeName", "src": "236:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "argumentTypes": null, "hexValue": "57464c", "id": 46, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "268:5:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_9452f9d3cf054b3d2c2930d36e45c182134441a15273d6d2a39e0407038eb022", "typeString": "literal_string \"WFL\"" }, "value": "WFL" }, "visibility": "public" }, { "constant": true, "id": 50, "name": "decimals", "nodeType": "VariableDeclaration", "scope": 417, "src": "280:35:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 48, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "280:5:1", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": { "argumentTypes": null, "hexValue": "3138", "id": 49, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "313:2:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_18_by_1", "typeString": "int_const 18" }, "value": "18" }, "visibility": "public" }, { "constant": false, "id": 52, "name": "totalSupply", "nodeType": "VariableDeclaration", "scope": 417, "src": "322:24:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 51, "name": "uint", "nodeType": "ElementaryTypeName", "src": "322:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 56, "name": "balanceOf", "nodeType": "VariableDeclaration", "scope": 417, "src": "353:41:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 55, "keyType": { "id": 53, "name": "address", "nodeType": "ElementaryTypeName", "src": "361:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "353:24:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 54, "name": "uint", "nodeType": "ElementaryTypeName", "src": "372:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 62, "name": "allowance", "nodeType": "VariableDeclaration", "scope": 417, "src": "401:61:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "typeName": { "id": 61, "keyType": { "id": 57, "name": "address", "nodeType": "ElementaryTypeName", "src": "409:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "401:44:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "valueType": { "id": 60, "keyType": { "id": 58, "name": "address", "nodeType": "ElementaryTypeName", "src": "428:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "420:24:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 59, "name": "uint", "nodeType": "ElementaryTypeName", "src": "439:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 64, "name": "DOMAIN_SEPARATOR", "nodeType": "VariableDeclaration", "scope": 417, "src": "471:31:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 63, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "471:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "public" }, { "constant": true, "id": 67, "name": "PERMIT_TYPEHASH", "nodeType": "VariableDeclaration", "scope": 417, "src": "614:108:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 65, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "614:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "307836653731656461653132623162393766346431663630333730666566313031303566613266616165303132363131346131363963363438343564363132366339", "id": 66, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "656:66:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_49955707469362902507454157297736832118868343942642399513960811609542965143241_by_1", "typeString": "int_const 4995...(69 digits omitted)...3241" }, "value": "0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9" }, "visibility": "public" }, { "constant": false, "id": 71, "name": "nonces", "nodeType": "VariableDeclaration", "scope": 417, "src": "729:38:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 70, "keyType": { "id": 68, "name": "address", "nodeType": "ElementaryTypeName", "src": "737:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "729:24:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 69, "name": "uint", "nodeType": "ElementaryTypeName", "src": "748:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 79, "name": "Approval", "nodeType": "EventDefinition", "parameters": { "id": 78, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 73, "indexed": true, "name": "owner", "nodeType": "VariableDeclaration", "scope": 79, "src": "791:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 72, "name": "address", "nodeType": "ElementaryTypeName", "src": "791:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 75, "indexed": true, "name": "spender", "nodeType": "VariableDeclaration", "scope": 79, "src": "814:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 74, "name": "address", "nodeType": "ElementaryTypeName", "src": "814:7:1", "stateMutability": "nonpayable",