UNPKG

@gooddollar/goodcontracts

Version:
1,228 lines 75.1 kB
{ "contractName": "TransferAndCallMock", "abi": [ { "inputs": [ { "internalType": "contract ERC20", "name": "_token", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "calledFallback", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_sender", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "onTokenTransfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "mockTransfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "wasCalled", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":true,\"inputs\":[],\"name\":\"calledFallback\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"mockTransfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"wasCalled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/mocks/TransferAndCallMock.sol\":\"TransferAndCallMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol\":{\"keccak256\":\"0xc5683b28527097379ed090b28bb46e17a50a2c57ddcb3c7e028fcd04ddc64aef\",\"urls\":[\"bzz-raw://639f6b6cf65382faea738e6326d6aeb289b8b030cf02f40c54bc45ec098eda6d\",\"dweb:/ipfs/QmQi7dFcKiwUxSbzhus4CxFTdNJvUsfiqY6i3bD4RdMQrn\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/mocks/TransferAndCallMock.sol\":{\"keccak256\":\"0x1fa5c621ad1556b152971d04560ebe7400fcf0ef342dbaa6cb10f136383a0843\",\"urls\":[\"bzz-raw://ace4e53ce53fb15ab85f2c7a489cece2da52dc665bafd3e85efa81fe176dca0c\",\"dweb:/ipfs/QmdxeBwCTBfG1iYdPGtXbp4QW17rypafTjwLv8RPpK4rr3\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xba431353cb4fe70777ac026231eb5468e41aa1e81240a2b8136917acc5fff4dc\",\"urls\":[\"bzz-raw://f40c91ca270bdc9b156f339081a0fc2bbcf73cf5f62b8c73ba555df753ff6619\",\"dweb:/ipfs/QmT8y2VVjGaFdGphpcXrgvdPi2EgF9LuCDgJiJ89LvpFRV\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]}},\"version\":1}", "bytecode": "0x60806040526000805460ff1916905534801561001a57600080fd5b506040516102ae3803806102ae8339818101604052602081101561003d57600080fd5b5051600080546001600160a01b0390921661010002610100600160a81b031990921691909117905561023a806100746000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063390f6426146100515780634554d23e1461006d578063a4c0ed3614610075578063c6803622146100fa575b600080fd5b610059610102565b604080519115158252519081900360200190f35b61005961010b565b6100596004803603606081101561008b57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b50909250905061011e565b6100596101f5565b60005460ff1681565b6000805460ff1916600190811790915590565b60008061016084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506101fe92505050565b600080546040805163a9059cbb60e01b81526001600160a01b038086166004830152602482018b90529151949550610100909204169263a9059cbb92604480840193602093929083900390910190829087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b505050506040513d60208110156101e957600080fd5b50519695505050505050565b60005460ff1690565b602001519056fea265627a7a723158205d362d42d892010dedd59002b75cacd217b917ec0f4fbc5b0acc35f8e3e3afeb64736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063390f6426146100515780634554d23e1461006d578063a4c0ed3614610075578063c6803622146100fa575b600080fd5b610059610102565b604080519115158252519081900360200190f35b61005961010b565b6100596004803603606081101561008b57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b50909250905061011e565b6100596101f5565b60005460ff1681565b6000805460ff1916600190811790915590565b60008061016084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506101fe92505050565b600080546040805163a9059cbb60e01b81526001600160a01b038086166004830152602482018b90529151949550610100909204169263a9059cbb92604480840193602093929083900390910190829087803b1580156101bf57600080fd5b505af11580156101d3573d6000803e3d6000fd5b505050506040513d60208110156101e957600080fd5b50519695505050505050565b60005460ff1690565b602001519056fea265627a7a723158205d362d42d892010dedd59002b75cacd217b917ec0f4fbc5b0acc35f8e3e3afeb64736f6c63430005100032", "sourceMap": "152:779:47:-;;;234:5;205:34;;-1:-1:-1;;205:34:47;;;263:64;5:2:-1;;;;30:1;27;20:12;5:2;263:64:47;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;263:64:47;306:5;:14;;-1:-1:-1;;;;;306:14:47;;;;;-1:-1:-1;;;;;;306:14:47;;;;;;;;;152:779;;;;;;", "deployedSourceMap": "152:779:47:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;152:779:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;205:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;567:105;;;:::i;333:228::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;333:228:47;;;;;;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;333:228:47;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;333:228:47;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;333:228:47;;-1:-1:-1;333:228:47;-1:-1:-1;333:228:47;:::i;678:86::-;;;:::i;205:34::-;;;;;;:::o;567:105::-;607:4;623:21;;-1:-1:-1;;623:21:47;640:4;623:21;;;;;;567:105;:::o;333:228::-;461:4;477:10;490:21;505:5;;490:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;490:14:47;;-1:-1:-1;;;490:21:47:i;:::-;528:5;;;:26;;;-1:-1:-1;;;528:26:47;;-1:-1:-1;;;;;528:26:47;;;;;;;;;;;;;;;477:34;;-1:-1:-1;528:5:47;;;;;;:14;;:26;;;;;;;;;;;;;;;;;;:5;:26;;;5:2:-1;;;;30:1;27;20:12;5:2;528:26:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;528:26:47;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;528:26:47;;333:228;-1:-1:-1;;;;;;333:228:47:o;678:86::-;720:4;743:14;;;678:86;:::o;770:159::-;909:2;898:14;892:21;;870:53::o", "source": "pragma solidity >0.5.4;\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";\nimport \"../../../contracts/token/ERC677/ERC677Receiver.sol\";\n\n\ncontract TransferAndCallMock is ERC677Receiver {\n bool public calledFallback = false;\n ERC20 token;\n\n constructor(ERC20 _token) public {\n token = _token;\n }\n\n function onTokenTransfer(\n address _sender,\n uint256 _value,\n bytes calldata _data\n ) external returns (bool) {\n address to = bytesToAddress(_data);\n return token.transfer(to, _value);\n }\n\n function mockTransfer() public returns (bool) {\n calledFallback = true;\n return true;\n }\n\n function wasCalled() public view returns (bool) {\n return calledFallback;\n }\n\n function bytesToAddress(bytes memory _data) internal view returns (address addr) {\n assembly {\n addr := mload(add(_data, 32))\n }\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/mocks/TransferAndCallMock.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/mocks/TransferAndCallMock.sol", "exportedSymbols": { "TransferAndCallMock": [ 12019 ] }, "id": 12020, "nodeType": "SourceUnit", "nodes": [ { "id": 11946, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:47" }, { "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "id": 11947, "nodeType": "ImportDirective", "scope": 12020, "sourceUnit": 21850, "src": "25:63:47", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol", "file": "../../../contracts/token/ERC677/ERC677Receiver.sol", "id": 11948, "nodeType": "ImportDirective", "scope": 12020, "sourceUnit": 3210, "src": "89:60:47", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 11949, "name": "ERC677Receiver", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3209, "src": "184:14:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC677Receiver_$3209", "typeString": "contract ERC677Receiver" } }, "id": 11950, "nodeType": "InheritanceSpecifier", "src": "184:14:47" } ], "contractDependencies": [ 3209 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 12019, "linearizedBaseContracts": [ 12019, 3209 ], "name": "TransferAndCallMock", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 11953, "name": "calledFallback", "nodeType": "VariableDeclaration", "scope": 12019, "src": "205:34:47", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 11951, "name": "bool", "nodeType": "ElementaryTypeName", "src": "205:4:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": { "argumentTypes": null, "hexValue": "66616c7365", "id": 11952, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "234:5:47", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "visibility": "public" }, { "constant": false, "id": 11955, "name": "token", "nodeType": "VariableDeclaration", "scope": 12019, "src": "245:11:47", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" }, "typeName": { "contractScope": null, "id": 11954, "name": "ERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21849, "src": "245:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "value": null, "visibility": "internal" }, { "body": { "id": 11964, "nodeType": "Block", "src": "296:31:47", "statements": [ { "expression": { "argumentTypes": null, "id": 11962, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11960, "name": "token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11955, "src": "306:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11961, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11957, "src": "314:6:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "src": "306:14:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "id": 11963, "nodeType": "ExpressionStatement", "src": "306:14:47" } ] }, "documentation": null, "id": 11965, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 11958, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11957, "name": "_token", "nodeType": "VariableDeclaration", "scope": 11965, "src": "275:12:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" }, "typeName": { "contractScope": null, "id": 11956, "name": "ERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21849, "src": "275:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "value": null, "visibility": "internal" } ], "src": "274:14:47" }, "returnParameters": { "id": 11959, "nodeType": "ParameterList", "parameters": [], "src": "296:0:47" }, "scope": 12019, "src": "263:64:47", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 11988, "nodeType": "Block", "src": "467:94:47", "statements": [ { "assignments": [ 11977 ], "declarations": [ { "constant": false, "id": 11977, "name": "to", "nodeType": "VariableDeclaration", "scope": 11988, "src": "477:10:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11976, "name": "address", "nodeType": "ElementaryTypeName", "src": "477:7:47", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "id": 11981, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 11979, "name": "_data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11971, "src": "505:5:47", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } ], "id": 11978, "name": "bytesToAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12018, "src": "490:14:47", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes_memory_ptr_$returns$_t_address_$", "typeString": "function (bytes memory) view returns (address)" } }, "id": 11980, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "490:21:47", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "VariableDeclarationStatement", "src": "477:34:47" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 11984, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11977, "src": "543:2:47", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 11985, "name": "_value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11969, "src": "547:6:47", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 11982, "name": "token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11955, "src": "528:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "id": 11983, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": 21493, "src": "528:14:47", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, "id": 11986, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "528:26:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 11975, "id": 11987, "nodeType": "Return", "src": "521:33:47" } ] }, "documentation": null, "id": 11989, "implemented": true, "kind": "function", "modifiers": [], "name": "onTokenTransfer", "nodeType": "FunctionDefinition", "parameters": { "id": 11972, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11967, "name": "_sender", "nodeType": "VariableDeclaration", "scope": 11989, "src": "367:15:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11966, "name": "address", "nodeType": "ElementaryTypeName", "src": "367:7:47", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11969, "name": "_value", "nodeType": "VariableDeclaration", "scope": 11989, "src": "392:14:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11968, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "392:7:47", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11971, "name": "_data", "nodeType": "VariableDeclaration", "scope": 11989, "src": "416:20:47", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes" }, "typeName": { "id": 11970, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "416:5:47", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "357:85:47" }, "returnParameters": { "id": 11975, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11974, "name": "", "nodeType": "VariableDeclaration", "scope": 11989, "src": "461:4:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 11973, "name": "bool", "nodeType": "ElementaryTypeName", "src": "461:4:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "460:6:47" }, "scope": 12019, "src": "333:228:47", "stateMutability": "nonpayable", "superFunction": 3208, "visibility": "external" }, { "body": { "id": 12000, "nodeType": "Block", "src": "613:59:47", "statements": [ { "expression": { "argumentTypes": null, "id": 11996, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11994, "name": "calledFallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11953, "src": "623:14:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 11995, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "640:4:47", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "623:21:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 11997, "nodeType": "ExpressionStatement", "src": "623:21:47" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", "id": 11998, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "661:4:47", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 11993, "id": 11999, "nodeType": "Return", "src": "654:11:47" } ] }, "documentation": null, "id": 12001, "implemented": true, "kind": "function", "modifiers": [], "name": "mockTransfer", "nodeType": "FunctionDefinition", "parameters": { "id": 11990, "nodeType": "ParameterList", "parameters": [], "src": "588:2:47" }, "returnParameters": { "id": 11993, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11992, "name": "", "nodeType": "VariableDeclaration", "scope": 12001, "src": "607:4:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 11991, "name": "bool", "nodeType": "ElementaryTypeName", "src": "607:4:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "606:6:47" }, "scope": 12019, "src": "567:105:47", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 12008, "nodeType": "Block", "src": "726:38:47", "statements": [ { "expression": { "argumentTypes": null, "id": 12006, "name": "calledFallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11953, "src": "743:14:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 12005, "id": 12007, "nodeType": "Return", "src": "736:21:47" } ] }, "documentation": null, "id": 12009, "implemented": true, "kind": "function", "modifiers": [], "name": "wasCalled", "nodeType": "FunctionDefinition", "parameters": { "id": 12002, "nodeType": "ParameterList", "parameters": [], "src": "696:2:47" }, "returnParameters": { "id": 12005, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12004, "name": "", "nodeType": "VariableDeclaration", "scope": 12009, "src": "720:4:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 12003, "name": "bool", "nodeType": "ElementaryTypeName", "src": "720:4:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "719:6:47" }, "scope": 12019, "src": "678:86:47", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 12017, "nodeType": "Block", "src": "851:78:47", "statements": [ { "externalReferences": [ { "addr": { "declaration": 12014, "isOffset": false, "isSlot": false, "src": "884:4:47", "valueSize": 1 } }, { "_data": { "declaration": 12011, "isOffset": false, "isSlot": false, "src": "902:5:47", "valueSize": 1 } } ], "id": 12016, "nodeType": "InlineAssembly", "operations": "{ addr := mload(add(_data, 32)) }", "src": "861:62:47" } ] }, "documentation": null, "id": 12018, "implemented": true, "kind": "function", "modifiers": [], "name": "bytesToAddress", "nodeType": "FunctionDefinition", "parameters": { "id": 12012, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12011, "name": "_data", "nodeType": "VariableDeclaration", "scope": 12018, "src": "794:18:47", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 12010, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "794:5:47", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "793:20:47" }, "returnParameters": { "id": 12015, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12014, "name": "addr", "nodeType": "VariableDeclaration", "scope": 12018, "src": "837:12:47", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 12013, "name": "address", "nodeType": "ElementaryTypeName", "src": "837:7:47", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "836:14:47" }, "scope": 12019, "src": "770:159:47", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 12020, "src": "152:779:47" } ], "src": "0:932:47" }, "legacyAST": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/mocks/TransferAndCallMock.sol", "exportedSymbols": { "TransferAndCallMock": [ 12019 ] }, "id": 12020, "nodeType": "SourceUnit", "nodes": [ { "id": 11946, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:47" }, { "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "file": "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol", "id": 11947, "nodeType": "ImportDirective", "scope": 12020, "sourceUnit": 21850, "src": "25:63:47", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol", "file": "../../../contracts/token/ERC677/ERC677Receiver.sol", "id": 11948, "nodeType": "ImportDirective", "scope": 12020, "sourceUnit": 3210, "src": "89:60:47", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 11949, "name": "ERC677Receiver", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3209, "src": "184:14:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC677Receiver_$3209", "typeString": "contract ERC677Receiver" } }, "id": 11950, "nodeType": "InheritanceSpecifier", "src": "184:14:47" } ], "contractDependencies": [ 3209 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 12019, "linearizedBaseContracts": [ 12019, 3209 ], "name": "TransferAndCallMock", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 11953, "name": "calledFallback", "nodeType": "VariableDeclaration", "scope": 12019, "src": "205:34:47", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 11951, "name": "bool", "nodeType": "ElementaryTypeName", "src": "205:4:47", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": { "argumentTypes": null, "hexValue": "66616c7365", "id": 11952, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "234:5:47", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "visibility": "public" }, { "constant": false, "id": 11955, "name": "token", "nodeType": "VariableDeclaration", "scope": 12019, "src": "245:11:47", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" }, "typeName": { "contractScope": null, "id": 11954, "name": "ERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21849, "src": "245:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "value": null, "visibility": "internal" }, { "body": { "id": 11964, "nodeType": "Block", "src": "296:31:47", "statements": [ { "expression": { "argumentTypes": null, "id": 11962, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11960, "name": "token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11955, "src": "306:5:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11961, "name": "_token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11957, "src": "314:6:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "src": "306:14:47", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC20_$21849", "typeString": "contract ERC20" } }, "id": 11963, "nodeType": "ExpressionStatement", "src": "306:14:47" } ] }, "documentation": null, "id": 11965, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 11958, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11957, "name": "_token", "nodeType": "VariableDeclaration", "scope": 11965, "src": "275:12:47", "stateVariable": false, "storageLocation": "