@gooddollar/goodcontracts
Version:
GoodDollar Contracts
1,245 lines • 65.5 kB
JSON
{
"contractName": "TransferAndCallMock",
"abi": [
{
"constant": true,
"inputs": [],
"name": "calledFallback",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "sender",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "value",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"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\":[{\"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\":\"sender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"value\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"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/contracts/mocks/TransferAndCallMock.sol\":\"TransferAndCallMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/mocks/TransferAndCallMock.sol\":{\"keccak256\":\"0x40eea4aefb5329d9193c2ab5a3b7d43bf203042dec02047b311ee3884ffb0d2c\",\"urls\":[\"bzz-raw://1496d6db22d952f7fb912363daf48a232fa967a1dd1ec7f9180e9e8683f0a91c\",\"dweb:/ipfs/Qmb9LSWty5yQusph5Nj7Q4Wa7YnjhoGPysh2LgdgNjZMde\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol\":{\"keccak256\":\"0xc5683b28527097379ed090b28bb46e17a50a2c57ddcb3c7e028fcd04ddc64aef\",\"urls\":[\"bzz-raw://639f6b6cf65382faea738e6326d6aeb289b8b030cf02f40c54bc45ec098eda6d\",\"dweb:/ipfs/QmQi7dFcKiwUxSbzhus4CxFTdNJvUsfiqY6i3bD4RdMQrn\"]}},\"version\":1}",
"bytecode": "0x60806040526002805460ff1916905534801561001a57600080fd5b5061024f8061002a6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063390f6426146100675780633fa4f245146100835780634554d23e1461009d57806367e404ce146100a5578063a4c0ed36146100c9578063c68036221461014e575b600080fd5b61006f610156565b604080519115158252519081900360200190f35b61008b61015f565b60408051918252519081900360200190f35b61006f610165565b6100ad610178565b604080516001600160a01b039092168252519081900360200190f35b61006f600480360360608110156100df57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561010f57600080fd5b82018360208201111561012157600080fd5b8035906020019184600183028401116401000000008311171561014357600080fd5b509092509050610187565b61006f610211565b60025460ff1681565b60015481565b6002805460ff1916600190811790915590565b6000546001600160a01b031681565b600080546001600160a01b0319166001600160a01b03861617815560018490556040518190309085908590808383808284376040519201945060009350909150508083038183865af19150503d80600081146101ff576040519150601f19603f3d011682016040523d82523d6000602084013e610204565b606091505b5090979650505050505050565b60025460ff169056fea265627a7a72315820b14b53ac334bf487ed5e682282f783e63902a7ef1f67274292945094c27c330e64736f6c63430005100032",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063390f6426146100675780633fa4f245146100835780634554d23e1461009d57806367e404ce146100a5578063a4c0ed36146100c9578063c68036221461014e575b600080fd5b61006f610156565b604080519115158252519081900360200190f35b61008b61015f565b60408051918252519081900360200190f35b61006f610165565b6100ad610178565b604080516001600160a01b039092168252519081900360200190f35b61006f600480360360608110156100df57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561010f57600080fd5b82018360208201111561012157600080fd5b8035906020019184600183028401116401000000008311171561014357600080fd5b509092509050610187565b61006f610211565b60025460ff1681565b60015481565b6002805460ff1916600190811790915590565b6000546001600160a01b031681565b600080546001600160a01b0319166001600160a01b03861617815560018490556040518190309085908590808383808284376040519201945060009350909150508083038183865af19150503d80600081146101ff576040519150601f19603f3d011682016040523d82523d6000602084013e610204565b606091505b5090979650505050505050565b60025460ff169056fea265627a7a72315820b14b53ac334bf487ed5e682282f783e63902a7ef1f67274292945094c27c330e64736f6c63430005100032",
"sourceMap": "71:615:38:-;;;178:34;;;-1:-1:-1;;178:34:38;;;71:615;5:2:-1;;;;30:1;27;20:12;5:2;71:615:38;;;;;;;",
"deployedSourceMap": "71:615:38:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;71:615:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;178:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;151:20;;;:::i;:::-;;;;;;;;;;;;;;;;487:105;;;:::i;124:21::-;;;:::i;:::-;;;;-1:-1:-1;;;;;124:21:38;;;;;;;;;;;;;;219:262;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;219:262:38;;;;;;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;219:262:38;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;219:262:38;;;;;;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;219:262:38;;-1:-1:-1;219:262:38;-1:-1:-1;219:262:38;:::i;598:86::-;;;:::i;178:34::-;;;;;;:::o;151:20::-;;;;:::o;487:105::-;543:14;:21;;-1:-1:-1;;543:21:38;560:4;543:21;;;;;;487:105;:::o;124:21::-;;;-1:-1:-1;;;;;124:21:38;;:::o;219:262::-;347:4;363:16;;-1:-1:-1;;;;;;363:16:38;-1:-1:-1;;;;;363:16:38;;;;;-1:-1:-1;389:14:38;;;429:25;;347:4;;437;;448:5;;;;429:25;448:5;;;;429:25;1:33:-1;429:25:38;;45:16:-1;;;-1:-1;429:25:38;;-1:-1:-1;429:25:38;;-1:-1:-1;;429:25:38;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;-1:-1;414:40:38;;219:262;-1:-1:-1;;;;;;;219:262:38:o;598:86::-;663:14;;;;598:86;:::o",
"source": "pragma solidity >0.5.4;\n\nimport \"../token/ERC677/ERC677Receiver.sol\";\n\ncontract TransferAndCallMock is ERC677Receiver {\n address public sender;\n uint256 public value;\n\n bool public calledFallback = false;\n\n function onTokenTransfer(\n address _sender,\n uint256 _value,\n bytes calldata _data\n ) external returns (bool) {\n sender = _sender;\n value = _value;\n\n (bool res, ) = address(this).call(_data);\n return res;\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",
"sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/mocks/TransferAndCallMock.sol",
"ast": {
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/mocks/TransferAndCallMock.sol",
"exportedSymbols": {
"TransferAndCallMock": [
6859
]
},
"id": 6860,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6797,
"literals": [
"solidity",
">",
"0.5",
".4"
],
"nodeType": "PragmaDirective",
"src": "0:23:38"
},
{
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol",
"file": "../token/ERC677/ERC677Receiver.sol",
"id": 6798,
"nodeType": "ImportDirective",
"scope": 6860,
"sourceUnit": 7076,
"src": "25:44:38",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6799,
"name": "ERC677Receiver",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 7075,
"src": "103:14:38",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC677Receiver_$7075",
"typeString": "contract ERC677Receiver"
}
},
"id": 6800,
"nodeType": "InheritanceSpecifier",
"src": "103:14:38"
}
],
"contractDependencies": [
7075
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 6859,
"linearizedBaseContracts": [
6859,
7075
],
"name": "TransferAndCallMock",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 6802,
"name": "sender",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "124:21:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6801,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "124:7:38",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 6804,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "151:20:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6803,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "151:7:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 6807,
"name": "calledFallback",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "178:34:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6805,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "178:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 6806,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "207:5:38",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"visibility": "public"
},
{
"body": {
"id": 6837,
"nodeType": "Block",
"src": "353:128:38",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6818,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6802,
"src": "363:6:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6819,
"name": "_sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6809,
"src": "372:7:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "363:16:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 6821,
"nodeType": "ExpressionStatement",
"src": "363:16:38"
},
{
"expression": {
"argumentTypes": null,
"id": 6824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6822,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6804,
"src": "389:5:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6823,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6811,
"src": "397:6:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "389:14:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 6825,
"nodeType": "ExpressionStatement",
"src": "389:14:38"
},
{
"assignments": [
6827,
null
],
"declarations": [
{
"constant": false,
"id": 6827,
"name": "res",
"nodeType": "VariableDeclaration",
"scope": 6837,
"src": "415:8:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6826,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "415:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
null
],
"id": 6834,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6832,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6813,
"src": "448:5:38",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6829,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18189,
"src": "437:4:38",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TransferAndCallMock_$6859",
"typeString": "contract TransferAndCallMock"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_TransferAndCallMock_$6859",
"typeString": "contract TransferAndCallMock"
}
],
"id": 6828,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "429:7:38",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 6830,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "429:13:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 6831,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "429:18:38",
"typeDescriptions": {
"typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) payable returns (bool,bytes memory)"
}
},
"id": 6833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "429:25:38",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "414:40:38"
},
{
"expression": {
"argumentTypes": null,
"id": 6835,
"name": "res",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6827,
"src": "471:3:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 6817,
"id": 6836,
"nodeType": "Return",
"src": "464:10:38"
}
]
},
"documentation": null,
"id": 6838,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "onTokenTransfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6814,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6809,
"name": "_sender",
"nodeType": "VariableDeclaration",
"scope": 6838,
"src": "253:15:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6808,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "253:7:38",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6811,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 6838,
"src": "278:14:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6810,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "278:7:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6813,
"name": "_data",
"nodeType": "VariableDeclaration",
"scope": 6838,
"src": "302:20:38",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6812,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "302:5:38",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "243:85:38"
},
"returnParameters": {
"id": 6817,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6816,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6838,
"src": "347:4:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6815,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "347:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "346:6:38"
},
"scope": 6859,
"src": "219:262:38",
"stateMutability": "nonpayable",
"superFunction": 7074,
"visibility": "external"
},
{
"body": {
"id": 6849,
"nodeType": "Block",
"src": "533:59:38",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6845,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6843,
"name": "calledFallback",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6807,
"src": "543:14:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 6844,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "560:4:38",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "543:21:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 6846,
"nodeType": "ExpressionStatement",
"src": "543:21:38"
},
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 6847,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "581:4:38",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 6842,
"id": 6848,
"nodeType": "Return",
"src": "574:11:38"
}
]
},
"documentation": null,
"id": 6850,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "mockTransfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6839,
"nodeType": "ParameterList",
"parameters": [],
"src": "508:2:38"
},
"returnParameters": {
"id": 6842,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6841,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6850,
"src": "527:4:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6840,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "527:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "526:6:38"
},
"scope": 6859,
"src": "487:105:38",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 6857,
"nodeType": "Block",
"src": "646:38:38",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6855,
"name": "calledFallback",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6807,
"src": "663:14:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 6854,
"id": 6856,
"nodeType": "Return",
"src": "656:21:38"
}
]
},
"documentation": null,
"id": 6858,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "wasCalled",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6851,
"nodeType": "ParameterList",
"parameters": [],
"src": "616:2:38"
},
"returnParameters": {
"id": 6854,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6853,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6858,
"src": "640:4:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6852,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "640:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "639:6:38"
},
"scope": 6859,
"src": "598:86:38",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 6860,
"src": "71:615:38"
}
],
"src": "0:687:38"
},
"legacyAST": {
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/mocks/TransferAndCallMock.sol",
"exportedSymbols": {
"TransferAndCallMock": [
6859
]
},
"id": 6860,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6797,
"literals": [
"solidity",
">",
"0.5",
".4"
],
"nodeType": "PragmaDirective",
"src": "0:23:38"
},
{
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/token/ERC677/ERC677Receiver.sol",
"file": "../token/ERC677/ERC677Receiver.sol",
"id": 6798,
"nodeType": "ImportDirective",
"scope": 6860,
"sourceUnit": 7076,
"src": "25:44:38",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6799,
"name": "ERC677Receiver",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 7075,
"src": "103:14:38",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC677Receiver_$7075",
"typeString": "contract ERC677Receiver"
}
},
"id": 6800,
"nodeType": "InheritanceSpecifier",
"src": "103:14:38"
}
],
"contractDependencies": [
7075
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 6859,
"linearizedBaseContracts": [
6859,
7075
],
"name": "TransferAndCallMock",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 6802,
"name": "sender",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "124:21:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6801,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "124:7:38",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 6804,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "151:20:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6803,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "151:7:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 6807,
"name": "calledFallback",
"nodeType": "VariableDeclaration",
"scope": 6859,
"src": "178:34:38",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6805,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "178:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 6806,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "207:5:38",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"visibility": "public"
},
{
"body": {
"id": 6837,
"nodeType": "Block",
"src": "353:128:38",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6818,
"name": "sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6802,
"src": "363:6:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6819,
"name": "_sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6809,
"src": "372:7:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "363:16:38",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 6821,
"nodeType": "ExpressionStatement",
"src": "363:16:38"
},
{
"expression": {
"argumentTypes": null,
"id": 6824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6822,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6804,
"src": "389:5:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6823,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6811,
"src": "397:6:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "389:14:38",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 6825,
"nodeType": "ExpressionStatement",
"src": "389:14:38"
},
{
"assignments": [
6827,
null
],
"declarations": [
{
"constant": false,
"id": 6827,
"name": "res",
"nodeType": "VariableDeclaration",
"scope": 6837,
"src": "415:8:38",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6826,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "415:4:38",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
null
],
"id": 6834,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6832,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6813,
"src": "448:5:38",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6829,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18189,
"src": "437:4:38",
"typeDescriptions": {
"typeIdentifier": "t_contract$_TransferAndCallMock_$6859",
"typeString": "contract TransferAndCallMock"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_TransferAndCallMock_$6859",
"typeString": "contract TransferAndCallMock"
}
],
"id": 6828,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "429:7:38",
"typeDescription