UNPKG

@windfallswap/core

Version:

🎛 Core contracts for the Windfall Swap protocol

878 lines • 34.6 kB
{ "contractName": "Migrations", "abi": [ { "constant": true, "inputs": [], "name": "last_completed_migration", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "completed", "type": "uint256" } ], "name": "setCompleted", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/D/defi/windfall/windfallswap-core/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/D/defi/windfall/windfallswap-core/contracts/Migrations.sol\":{\"keccak256\":\"0x7797e159bfd6b953422b4bd6d5de5946971d8b5ed74c4b1f6517d61fe236b851\",\"urls\":[\"bzz-raw://56bdf6130f3ced3e78baa0f3e7f34cb4c5131d90721326056bbf0dd202d8539d\",\"dweb:/ipfs/QmZqRKebKwn6YXejnnPribsyiXLmrAx32JpatFhvS76NKp\"]}},\"version\":1}", "bytecode": "0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b506101af806100326000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610060578063fdacd57614610091575b600080fd5b61004e6100b0565b60408051918252519081900360200190f35b6100686100b6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ae600480360360208110156100a757600080fd5b50356100d2565b005b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101486033913960400191505060405180910390fd5b60015556fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582084396a001678d0983d77aede77d7c7d08be61d7971658bb49e74e29170c04cb764736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610060578063fdacd57614610091575b600080fd5b61004e6100b0565b60408051918252519081900360200190f35b6100686100b6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ae600480360360208110156100a757600080fd5b50356100d2565b005b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101486033913960400191505060405180910390fd5b60015556fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582084396a001678d0983d77aede77d7c7d08be61d7971658bb49e74e29170c04cb764736f6c63430005100032", "sourceMap": "66:352:0:-;;;90:33;;;-1:-1:-1;;;;;;90:33:0;113:10;90:33;;;66:352;5:2:-1;;;;30:1;27;20:12;5:2;66:352:0;;;;;;;", "deployedSourceMap": "66:352:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;66:352:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;127:36;;;:::i;:::-;;;;;;;;;;;;;;;;90:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;313:103;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;313:103:0;;:::i;:::-;;127:36;;;;:::o;90:33::-;;;;;;:::o;313:103::-;225:5;;;;211:10;:19;196:101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;375:24;:36;313:103::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.22 <0.8.0;\n\ncontract Migrations {\n address public owner = msg.sender;\n uint public last_completed_migration;\n\n modifier restricted() {\n require(\n msg.sender == owner,\n \"This function is restricted to the contract's owner\"\n );\n _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n}\n", "sourcePath": "D:/defi/windfall/windfallswap-core/contracts/Migrations.sol", "ast": { "absolutePath": "/D/defi/windfall/windfallswap-core/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 32 ] }, "id": 33, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".22", "<", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "32:32:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 32, "linearizedBaseContracts": [ 32 ], "name": "Migrations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 5, "name": "owner", "nodeType": "VariableDeclaration", "scope": 32, "src": "90:33:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2, "name": "address", "nodeType": "ElementaryTypeName", "src": "90:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2400, "src": "113:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 4, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "113:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "visibility": "public" }, { "constant": false, "id": 7, "name": "last_completed_migration", "nodeType": "VariableDeclaration", "scope": 32, "src": "127:36:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6, "name": "uint", "nodeType": "ElementaryTypeName", "src": "127:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 18, "nodeType": "Block", "src": "190:119:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 13, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 10, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2400, "src": "211:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 11, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "211:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 12, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "225:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "211:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572", "id": 14, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "238:53:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "typeString": "literal_string \"This function is restricted to the contract's owner\"" }, "value": "This function is restricted to the contract's owner" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "typeString": "literal_string \"This function is restricted to the contract's owner\"" } ], "id": 9, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2403, 2404 ], "referencedDeclaration": 2404, "src": "196:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 15, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "196:101:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 16, "nodeType": "ExpressionStatement", "src": "196:101:0" }, { "id": 17, "nodeType": "PlaceholderStatement", "src": "303:1:0" } ] }, "documentation": null, "id": 19, "name": "restricted", "nodeType": "ModifierDefinition", "parameters": { "id": 8, "nodeType": "ParameterList", "parameters": [], "src": "187:2:0" }, "src": "168:141:0", "visibility": "internal" }, { "body": { "id": 30, "nodeType": "Block", "src": "369:47:0", "statements": [ { "expression": { "argumentTypes": null, "id": 28, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 26, "name": "last_completed_migration", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "375:24:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 27, "name": "completed", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21, "src": "402:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "375:36:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 29, "nodeType": "ExpressionStatement", "src": "375:36:0" } ] }, "documentation": null, "id": 31, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 24, "modifierName": { "argumentTypes": null, "id": 23, "name": "restricted", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "358:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "358:10:0" } ], "name": "setCompleted", "nodeType": "FunctionDefinition", "parameters": { "id": 22, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 21, "name": "completed", "nodeType": "VariableDeclaration", "scope": 31, "src": "335:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 20, "name": "uint", "nodeType": "ElementaryTypeName", "src": "335:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "334:16:0" }, "returnParameters": { "id": 25, "nodeType": "ParameterList", "parameters": [], "src": "369:0:0" }, "scope": 32, "src": "313:103:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 33, "src": "66:352:0" } ], "src": "32:387:0" }, "legacyAST": { "absolutePath": "/D/defi/windfall/windfallswap-core/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 32 ] }, "id": 33, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".22", "<", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "32:32:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 32, "linearizedBaseContracts": [ 32 ], "name": "Migrations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 5, "name": "owner", "nodeType": "VariableDeclaration", "scope": 32, "src": "90:33:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2, "name": "address", "nodeType": "ElementaryTypeName", "src": "90:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2400, "src": "113:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 4, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "113:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "visibility": "public" }, { "constant": false, "id": 7, "name": "last_completed_migration", "nodeType": "VariableDeclaration", "scope": 32, "src": "127:36:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6, "name": "uint", "nodeType": "ElementaryTypeName", "src": "127:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 18, "nodeType": "Block", "src": "190:119:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 13, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 10, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2400, "src": "211:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 11, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "211:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 12, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "225:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "211:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572", "id": 14, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "238:53:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "typeString": "literal_string \"This function is restricted to the contract's owner\"" }, "value": "This function is restricted to the contract's owner" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "typeString": "literal_string \"This function is restricted to the contract's owner\"" } ], "id": 9, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2403, 2404 ], "referencedDeclaration": 2404, "src": "196:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 15, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "196:101:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 16, "nodeType": "ExpressionStatement", "src": "196:101:0" }, { "id": 17, "nodeType": "PlaceholderStatement", "src": "303:1:0" } ] }, "documentation": null, "id": 19, "name": "restricted", "nodeType": "ModifierDefinition", "parameters": { "id": 8, "nodeType": "ParameterList", "parameters": [], "src": "187:2:0" }, "src": "168:141:0", "visibility": "internal" }, { "body": { "id": 30, "nodeType": "Block", "src": "369:47:0", "statements": [ { "expression": { "argumentTypes": null, "id": 28, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 26, "name": "last_completed_migration", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "375:24:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 27, "name": "completed", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21, "src": "402:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "375:36:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 29, "nodeType": "ExpressionStatement", "src": "375:36:0" } ] }, "documentation": null, "id": 31, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 24, "modifierName": { "argumentTypes": null, "id": 23, "name": "restricted", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "358:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "358:10:0" } ], "name": "setCompleted", "nodeType": "FunctionDefinition", "parameters": { "id": 22, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 21, "name": "completed", "nodeType": "VariableDeclaration", "scope": 31, "src": "335:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 20, "name": "uint", "nodeType": "ElementaryTypeName", "src": "335:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "334:16:0" }, "returnParameters": { "id": 25, "nodeType": "ParameterList", "parameters": [], "src": "369:0:0" }, "scope": 32, "src": "313:103:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 33, "src": "66:352:0" } ], "src": "32:387:0" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.3.2", "updatedAt": "2020-12-24T12:08:49.492Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }