UNPKG

@valueswap/v2-periphery

Version:

🎚 Peripheral smart contracts for interacting with Valueswap V2

946 lines • 36.9 kB
{ "contractName": "Migrations", "abi": [ { "inputs": [], "name": "last_completed_migration", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "completed", "type": "uint256" } ], "name": "setCompleted", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/Users/second/Documents/work/valueswap-v2-periphery/contracts/Migrations.sol\":{\"keccak256\":\"0x7eaedbb1a3e4e0f585d9063393872f88ded247ca3c3c3c8492ea18e7629a6411\",\"urls\":[\"bzz-raw://4a3eb571cee910095df65a06a1c1d3f89187c72a3c184ef87a7538d9aa39ad07\",\"dweb:/ipfs/QmdqR3vrSSGR49qFGZr49Mb39z7dgD6tSzEDoaqtM31o61\"]}},\"version\":1}", "bytecode": "0x6080604052600080546001600160a01b0319163317905534801561002257600080fd5b506101b0806100326000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610060578063fdacd57614610091575b600080fd5b61004e6100b0565b60408051918252519081900360200190f35b6100686100b6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ae600480360360208110156100a757600080fd5b50356100d2565b005b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101486033913960400191505060405180910390fd5b60015556fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a2646970667358221220533cf56f1b6eb3f2ba08e4081e40ba55b85b4009e20b6d36f32270a1317216d964736f6c63430006060033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610060578063fdacd57614610091575b600080fd5b61004e6100b0565b60408051918252519081900360200190f35b6100686100b6565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100ae600480360360208110156100a757600080fd5b50356100d2565b005b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101486033913960400191505060405180910390fd5b60015556fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a2646970667358221220533cf56f1b6eb3f2ba08e4081e40ba55b85b4009e20b6d36f32270a1317216d964736f6c63430006060033", "immutableReferences": {}, "sourceMap": "66:352:0:-:0;;;90:33;;;-1:-1:-1;;;;;;90:33:0;113:10;90:33;;;66:352;2:2:-1;;;;27:1;24;17:12;2:2;66:352:0;;;;;;;", "deployedSourceMap": "66:352:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;66:352:0;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;127:36:0;;;:::i;:::-;;;;;;;;;;;;;;;;90:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;313:103;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;313:103:0;;:::i;:::-;;127:36;;;;:::o;90:33::-;;;;;;:::o;313:103::-;225:5;;;;211:10;:19;196:101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;375:24:::1;:36:::0;313:103::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.22 <0.9.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": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/Migrations.sol", "ast": { "absolutePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 32 ] }, "id": 33, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".22", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "32:32:0" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 32, "linearizedBaseContracts": [ 32 ], "name": "Migrations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "8da5cb5b", "id": 5, "mutability": "mutable", "name": "owner", "nodeType": "VariableDeclaration", "overrides": null, "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": -15, "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, "functionSelector": "445df0ac", "id": 7, "mutability": "mutable", "name": "last_completed_migration", "nodeType": "VariableDeclaration", "overrides": null, "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": -15, "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": [ -18, -18 ], "referencedDeclaration": -18, "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", "tryCall": false, "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", "overrides": null, "parameters": { "id": 8, "nodeType": "ParameterList", "parameters": [], "src": "187:2:0" }, "src": "168:141:0", "virtual": false, "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, "functionSelector": "fdacd576", "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", "overrides": null, "parameters": { "id": 22, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 21, "mutability": "mutable", "name": "completed", "nodeType": "VariableDeclaration", "overrides": null, "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", "virtual": false, "visibility": "public" } ], "scope": 33, "src": "66:352:0" } ], "src": "32:387:0" }, "legacyAST": { "attributes": { "absolutePath": "/Users/second/Documents/work/valueswap-v2-periphery/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 32 ] } }, "children": [ { "attributes": { "literals": [ "solidity", ">=", "0.4", ".22", "<", "0.9", ".0" ] }, "id": 1, "name": "PragmaDirective", "src": "32:32:0" }, { "attributes": { "abstract": false, "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ 32 ], "name": "Migrations", "scope": 33 }, "children": [ { "attributes": { "constant": false, "functionSelector": "8da5cb5b", "mutability": "mutable", "name": "owner", "overrides": null, "scope": 32, "stateVariable": true, "storageLocation": "default", "type": "address", "visibility": "public" }, "children": [ { "attributes": { "name": "address", "stateMutability": "nonpayable", "type": "address" }, "id": 2, "name": "ElementaryTypeName", "src": "90:7:0" }, { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "sender", "referencedDeclaration": null, "type": "address payable" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": -15, "type": "msg", "value": "msg" }, "id": 3, "name": "Identifier", "src": "113:3:0" } ], "id": 4, "name": "MemberAccess", "src": "113:10:0" } ], "id": 5, "name": "VariableDeclaration", "src": "90:33:0" }, { "attributes": { "constant": false, "functionSelector": "445df0ac", "mutability": "mutable", "name": "last_completed_migration", "overrides": null, "scope": 32, "stateVariable": true, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "public" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 6, "name": "ElementaryTypeName", "src": "127:4:0" } ], "id": 7, "name": "VariableDeclaration", "src": "127:36:0" }, { "attributes": { "documentation": null, "name": "restricted", "overrides": null, "virtual": false, "visibility": "internal" }, "children": [ { "attributes": { "parameters": [ null ] }, "children": [], "id": 8, "name": "ParameterList", "src": "187:2:0" }, { "children": [ { "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "isStructConstructorCall": false, "lValueRequested": false, "names": [ null ], "tryCall": false, "type": "tuple()", "type_conversion": false }, "children": [ { "attributes": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "typeString": "literal_string \"This function is restricted to the contract's owner\"" } ], "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "type": "function (bool,string memory) pure", "value": "require" }, "id": 9, "name": "Identifier", "src": "196:7:0" }, { "attributes": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "operator": "==", "type": "bool" }, "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "sender", "referencedDeclaration": null, "type": "address payable" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": -15, "type": "msg", "value": "msg" }, "id": 10, "name": "Identifier", "src": "211:3:0" } ], "id": 11, "name": "MemberAccess", "src": "211:10:0" }, { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 5, "type": "address", "value": "owner" }, "id": 12, "name": "Identifier", "src": "225:5:0" } ], "id": 13, "name": "BinaryOperation", "src": "211:19:0" }, { "attributes": { "argumentTypes": null, "hexvalue": "546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572", "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "subdenomination": null, "token": "string", "type": "literal_string \"This function is restricted to the contract's owner\"", "value": "This function is restricted to the contract's owner" }, "id": 14, "name": "Literal", "src": "238:53:0" } ], "id": 15, "name": "FunctionCall", "src": "196:101:0" } ], "id": 16, "name": "ExpressionStatement", "src": "196:101:0" }, { "id": 17, "name": "PlaceholderStatement", "src": "303:1:0" } ], "id": 18, "name": "Block", "src": "190:119:0" } ], "id": 19, "name": "ModifierDefinition", "src": "168:141:0" }, { "attributes": { "documentation": null, "functionSelector": "fdacd576", "implemented": true, "isConstructor": false, "kind": "function", "name": "setCompleted", "overrides": null, "scope": 32, "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "completed", "overrides": null, "scope": 31, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 20, "name": "ElementaryTypeName", "src": "335:4:0" } ], "id": 21, "name": "VariableDeclaration", "src": "335:14:0" } ], "id": 22, "name": "ParameterList", "src": "334:16:0" }, { "attributes": { "parameters": [ null ] }, "children": [], "id": 25, "name": "ParameterList", "src": "369:0:0" }, { "attributes": { "arguments": null }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 19, "type": "modifier ()", "value": "restricted" }, "id": 23, "name": "Identifier", "src": "358:10:0" } ], "id": 24, "name": "ModifierInvocation", "src": "358:10:0" }, { "children": [ { "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "operator": "=", "type": "uint256" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 7, "type": "uint256", "value": "last_completed_migration" }, "id": 26, "name": "Identifier", "src": "375:24:0" }, { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 21, "type": "uint256", "value": "completed" }, "id": 27, "name": "Identifier", "src": "402:9:0" } ], "id": 28, "name": "Assignment", "src": "375:36:0" } ], "id": 29, "name": "ExpressionStatement", "src": "375:36:0" } ], "id": 30, "name": "Block", "src": "369:47:0" } ], "id": 31, "name": "FunctionDefinition", "src": "313:103:0" } ], "id": 32, "name": "ContractDefinition", "src": "66:352:0" } ], "id": 33, "name": "SourceUnit", "src": "32:387:0" }, "compiler": { "name": "solc", "version": "0.6.6+commit.6c089d02.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.3.3", "updatedAt": "2021-01-30T15:45:24.094Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }