UNPKG

@hyperledger/cactus-plugin-ledger-connector-besu

Version:

Allows Cactus nodes to connect to a Besu ledger.

724 lines (723 loc) 336 kB
{ "contractName": "HelloWorld", "abi": [ { "inputs": [], "name": "sayHello", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "getName", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "getNameByIndex", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "newName", "type": "string" } ], "name": "setName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "deposit", "outputs": [], "stateMutability": "payable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getNameByIndex\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sayHello\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol\":\"HelloWorld\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol\":{\"keccak256\":\"0x1e97027d32e8c3433b793d7b2b45e30ea2d341c96a3943508ba068dea106efab\",\"urls\":[\"bzz-raw://96e37a0bb119b1fe14a4e71627c077b180f4deb9acc4284aa987a3ca1a6f45b1\",\"dweb:/ipfs/QmTAiGsxb38hMgDgbrtLLdYxc76CposiN9moBuJXAg2Mgk\"]}},\"version\":1}", "bytecode": "60806040526040518060400160405280600d81526020017f4361707461696e436163747573000000000000000000000000000000000000008152506000908051906020019061004f929190610062565b5034801561005c57600080fd5b50610166565b82805461006e90610105565b90600052602060002090601f01602090048101928261009057600085556100d7565b82601f106100a957805160ff19168380011785556100d7565b828001600101855582156100d7579182015b828111156100d65782518255916020019190600101906100bb565b5b5090506100e491906100e8565b5090565b5b808211156101015760008160009055506001016100e9565b5090565b6000600282049050600182168061011d57607f821691505b6020821081141561013157610130610137565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b61082c806101756000396000f3fe60806040526004361061004a5760003560e01c806317d7de7c1461004f57806359c293f11461007a578063c47f0027146100b7578063d0e30db0146100e0578063ef5fb05b146100ea575b600080fd5b34801561005b57600080fd5b50610064610115565b60405161007191906105ae565b60405180910390f35b34801561008657600080fd5b506100a1600480360381019061009c919061050c565b6101a7565b6040516100ae91906105ae565b60405180910390f35b3480156100c357600080fd5b506100de60048036038101906100d991906104cb565b61027d565b005b6100e86102d3565b005b3480156100f657600080fd5b506100ff61036e565b60405161010c91906105ae565b60405180910390f35b6060600080546101249061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546101509061070f565b801561019d5780601f106101725761010080835404028352916020019161019d565b820191906000526020600020905b81548152906001019060200180831161018057829003601f168201915b5050505050905090565b6060600282815481106101e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200180546101f89061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546102249061070f565b80156102715780601f1061024657610100808354040283529160200191610271565b820191906000526020600020905b81548152906001019060200180831161025457829003601f168201915b50505050509050919050565b80600090805190602001906102939291906103ab565b506002819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906102cf9291906103ab565b5050565b60003411610316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030d906105d0565b60405180910390fd5b34600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610365919061066d565b92505081905550565b60606040518060400160405280600c81526020017f48656c6c6f20576f726c64210000000000000000000000000000000000000000815250905090565b8280546103b79061070f565b90600052602060002090601f0160209004810192826103d95760008555610420565b82601f106103f257805160ff1916838001178555610420565b82800160010185558215610420579182015b8281111561041f578251825591602001919060010190610404565b5b50905061042d9190610431565b5090565b5b8082111561044a576000816000905550600101610432565b5090565b600061046161045c84610621565b6105f0565b90508281526020810184848401111561047957600080fd5b6104848482856106cd565b509392505050565b600082601f83011261049d57600080fd5b81356104ad84826020860161044e565b91505092915050565b6000813590506104c5816107df565b92915050565b6000602082840312156104dd57600080fd5b600082013567ffffffffffffffff8111156104f757600080fd5b6105038482850161048c565b91505092915050565b60006020828403121561051e57600080fd5b600061052c848285016104b6565b91505092915050565b600061054082610651565b61054a818561065c565b935061055a8185602086016106dc565b610563816107ce565b840191505092915050565b600061057b601b8361065c565b91507f56616c7565206d757374206265206469666572656e74206f66203000000000006000830152602082019050919050565b600060208201905081810360008301526105c88184610535565b905092915050565b600060208201905081810360008301526105e98161056e565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156106175761061661079f565b5b8060405250919050565b600067ffffffffffffffff82111561063c5761063b61079f565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000610678826106c3565b9150610683836106c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156106b8576106b7610741565b5b828201905092915050565b6000819050919050565b82818337600083830152505050565b60005b838110156106fa5780820151818401526020810190506106df565b83811115610709576000848401525b50505050565b6000600282049050600182168061072757607f821691505b6020821081141561073b5761073a610770565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6107e8816106c3565b81146107f357600080fd5b5056fea2646970667358221220450aa5d16069485df7d037ffe43b6593e232f4ac514d9169ba271384cc5d841964736f6c63430008000033", "deployedBytecode": "60806040526004361061004a5760003560e01c806317d7de7c1461004f57806359c293f11461007a578063c47f0027146100b7578063d0e30db0146100e0578063ef5fb05b146100ea575b600080fd5b34801561005b57600080fd5b50610064610115565b60405161007191906105ae565b60405180910390f35b34801561008657600080fd5b506100a1600480360381019061009c919061050c565b6101a7565b6040516100ae91906105ae565b60405180910390f35b3480156100c357600080fd5b506100de60048036038101906100d991906104cb565b61027d565b005b6100e86102d3565b005b3480156100f657600080fd5b506100ff61036e565b60405161010c91906105ae565b60405180910390f35b6060600080546101249061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546101509061070f565b801561019d5780601f106101725761010080835404028352916020019161019d565b820191906000526020600020905b81548152906001019060200180831161018057829003601f168201915b5050505050905090565b6060600282815481106101e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200180546101f89061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546102249061070f565b80156102715780601f1061024657610100808354040283529160200191610271565b820191906000526020600020905b81548152906001019060200180831161025457829003601f168201915b50505050509050919050565b80600090805190602001906102939291906103ab565b506002819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906102cf9291906103ab565b5050565b60003411610316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030d906105d0565b60405180910390fd5b34600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610365919061066d565b92505081905550565b60606040518060400160405280600c81526020017f48656c6c6f20576f726c64210000000000000000000000000000000000000000815250905090565b8280546103b79061070f565b90600052602060002090601f0160209004810192826103d95760008555610420565b82601f106103f257805160ff1916838001178555610420565b82800160010185558215610420579182015b8281111561041f578251825591602001919060010190610404565b5b50905061042d9190610431565b5090565b5b8082111561044a576000816000905550600101610432565b5090565b600061046161045c84610621565b6105f0565b90508281526020810184848401111561047957600080fd5b6104848482856106cd565b509392505050565b600082601f83011261049d57600080fd5b81356104ad84826020860161044e565b91505092915050565b6000813590506104c5816107df565b92915050565b6000602082840312156104dd57600080fd5b600082013567ffffffffffffffff8111156104f757600080fd5b6105038482850161048c565b91505092915050565b60006020828403121561051e57600080fd5b600061052c848285016104b6565b91505092915050565b600061054082610651565b61054a818561065c565b935061055a8185602086016106dc565b610563816107ce565b840191505092915050565b600061057b601b8361065c565b91507f56616c7565206d757374206265206469666572656e74206f66203000000000006000830152602082019050919050565b600060208201905081810360008301526105c88184610535565b905092915050565b600060208201905081810360008301526105e98161056e565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156106175761061661079f565b5b8060405250919050565b600067ffffffffffffffff82111561063c5761063b61079f565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000610678826106c3565b9150610683836106c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156106b8576106b7610741565b5b828201905092915050565b6000819050919050565b82818337600083830152505050565b60005b838110156106fa5780820151818401526020810190506106df565b83811115610709576000848401525b50505050565b6000600282049050600182168061072757607f821691505b6020821081141561073b5761073a610770565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6107e8816106c3565b81146107f357600080fd5b5056fea2646970667358221220450aa5d16069485df7d037ffe43b6593e232f4ac514d9169ba271384cc5d841964736f6c63430008000033", "immutableReferences": {}, "generatedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:516:2", "statements": [ { "body": { "nodeType": "YulBlock", "src": "58:269:2", "statements": [ { "nodeType": "YulAssignment", "src": "68:22:2", "value": { "arguments": [ { "name": "data", "nodeType": "YulIdentifier", "src": "82:4:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "88:1:2", "type": "", "value": "2" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "78:3:2" }, "nodeType": "YulFunctionCall", "src": "78:12:2" }, "variableNames": [ { "name": "length", "nodeType": "YulIdentifier", "src": "68:6:2" } ] }, { "nodeType": "YulVariableDeclaration", "src": "99:38:2", "value": { "arguments": [ { "name": "data", "nodeType": "YulIdentifier", "src": "129:4:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "135:1:2", "type": "", "value": "1" } ], "functionName": { "name": "and", "nodeType": "YulIdentifier", "src": "125:3:2" }, "nodeType": "YulFunctionCall", "src": "125:12:2" }, "variables": [ { "name": "outOfPlaceEncoding", "nodeType": "YulTypedName", "src": "103:18:2", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "176:51:2", "statements": [ { "nodeType": "YulAssignment", "src": "190:27:2", "value": { "arguments": [ { "name": "length", "nodeType": "YulIdentifier", "src": "204:6:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "212:4:2", "type": "", "value": "0x7f" } ], "functionName": { "name": "and", "nodeType": "YulIdentifier", "src": "200:3:2" }, "nodeType": "YulFunctionCall", "src": "200:17:2" }, "variableNames": [ { "name": "length", "nodeType": "YulIdentifier", "src": "190:6:2" } ] } ] }, "condition": { "arguments": [ { "name": "outOfPlaceEncoding", "nodeType": "YulIdentifier", "src": "156:18:2" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "149:6:2" }, "nodeType": "YulFunctionCall", "src": "149:26:2" }, "nodeType": "YulIf", "src": "146:2:2" }, { "body": { "nodeType": "YulBlock", "src": "279:42:2", "statements": [ { "expression": { "arguments": [], "functionName": { "name": "panic_error_0x22", "nodeType": "YulIdentifier", "src": "293:16:2" }, "nodeType": "YulFunctionCall", "src": "293:18:2" }, "nodeType": "YulExpressionStatement", "src": "293:18:2" } ] }, "condition": { "arguments": [ { "name": "outOfPlaceEncoding", "nodeType": "YulIdentifier", "src": "243:18:2" }, { "arguments": [ { "name": "length", "nodeType": "YulIdentifier", "src": "266:6:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "274:2:2", "type": "", "value": "32" } ], "functionName": { "name": "lt", "nodeType": "YulIdentifier", "src": "263:2:2" }, "nodeType": "YulFunctionCall", "src": "263:14:2" } ], "functionName": { "name": "eq", "nodeType": "YulIdentifier", "src": "240:2:2" }, "nodeType": "YulFunctionCall", "src": "240:38:2" }, "nodeType": "YulIf", "src": "237:2:2" } ] }, "name": "extract_byte_array_length", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "data", "nodeType": "YulTypedName", "src": "42:4:2", "type": "" } ], "returnVariables": [ { "name": "length", "nodeType": "YulTypedName", "src": "51:6:2", "type": "" } ], "src": "7:320:2" }, { "body": { "nodeType": "YulBlock", "src": "361:152:2", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "378:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "381:77:2", "type": "", "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "371:6:2" }, "nodeType": "YulFunctionCall", "src": "371:88:2" }, "nodeType": "YulExpressionStatement", "src": "371:88:2" }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "475:1:2", "type": "", "value": "4" }, { "kind": "number", "nodeType": "YulLiteral", "src": "478:4:2", "type": "", "value": "0x22" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "468:6:2" }, "nodeType": "YulFunctionCall", "src": "468:15:2" }, "nodeType": "YulExpressionStatement", "src": "468:15:2" }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "499:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "502:4:2", "type": "", "value": "0x24" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "492:6:2" }, "nodeType": "YulFunctionCall", "src": "492:15:2" }, "nodeType": "YulExpressionStatement", "src": "492:15:2" } ] }, "name": "panic_error_0x22", "nodeType": "YulFunctionDefinition", "src": "333:180:2" } ] }, "contents": "{\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n}\n", "id": 2, "language": "Yul", "name": "#utility.yul" } ], "deployedGeneratedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:5780:2", "statements": [ { "body": { "nodeType": "YulBlock", "src": "91:260:2", "statements": [ { "nodeType": "YulAssignment", "src": "101:74:2", "value": { "arguments": [ { "arguments": [ { "name": "length", "nodeType": "YulIdentifier", "src": "167:6:2" } ], "functionName": { "name": "array_allocation_size_t_string_memory_ptr", "nodeType": "YulIdentifier", "src": "125:41:2" }, "nodeType": "YulFunctionCall", "src": "125:49:2" } ], "functionName": { "name": "allocateMemory", "nodeType": "YulIdentifier", "src": "110:14:2" }, "nodeType": "YulFunctionCall", "src": "110:65:2" }, "variableNames": [ { "name": "array", "nodeType": "YulIdentifier", "src": "101:5:2" } ] }, { "expression": { "arguments": [ { "name": "array", "nodeType": "YulIdentifier", "src": "191:5:2" }, { "name": "length", "nodeType": "YulIdentifier", "src": "198:6:2" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "184:6:2" }, "nodeType": "YulFunctionCall", "src": "184:21:2" }, "nodeType": "YulExpressionStatement", "src": "184:21:2" }, { "nodeType": "YulVariableDeclaration", "src": "214:27:2", "value": { "arguments": [ { "name": "array", "nodeType": "YulIdentifier", "src": "229:5:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "236:4:2", "type": "", "value": "0x20" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "225:3:2" }, "nodeType": "YulFunctionCall", "src": "225:16:2" }, "variables": [ { "name": "dst", "nodeType": "YulTypedName", "src": "218:3:2", "type": "" } ] }, { "body": { "nodeType": "YulBlock", "src": "279:16:2", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "288:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "291:1:2", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "281:6:2" }, "nodeType": "YulFunctionCall", "src": "281:12:2" }, "nodeType": "YulExpressionStatement", "src": "281:12:2" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "src", "nodeType": "YulIdentifier", "src": "260:3:2" }, { "name": "length", "nodeType": "YulIdentifier", "src": "265:6:2" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "256:3:2" }, "nodeType": "YulFunctionCall", "src": "256:16:2" }, { "name": "end", "nodeType": "YulIdentifier", "src": "274:3:2" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "253:2:2" }, "nodeType": "YulFunctionCall", "src": "253:25:2" }, "nodeType": "YulIf", "src": "250:2:2" }, { "expression": { "arguments": [ { "name": "src", "nodeType": "YulIdentifier", "src": "328:3:2" }, { "name": "dst", "nodeType": "YulIdentifier", "src": "333:3:2" }, { "name": "length", "nodeType": "YulIdentifier", "src": "338:6:2" } ], "functionName": { "name": "copy_calldata_to_memory", "nodeType": "YulIdentifier", "src": "304:23:2" }, "nodeType": "YulFunctionCall", "src": "304:41:2" }, "nodeType": "YulExpressionStatement", "src": "304:41:2" } ] }, "name": "abi_decode_available_length_t_string_memory_ptr", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "src", "nodeType": "YulTypedName", "src": "64:3:2", "type": "" }, { "name": "length", "nodeType": "YulTypedName", "src": "69:6:2", "type": "" }, { "name": "end", "nodeType": "YulTypedName", "src": "77:3:2", "type": "" } ], "returnVariables": [ { "name": "array", "nodeType": "YulTypedName", "src": "85:5:2", "type": "" } ], "src": "7:344:2" }, { "body": { "nodeType": "YulBlock", "src": "433:211:2", "statements": [ { "body": { "nodeType": "YulBlock", "src": "482:16:2", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "491:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "494:1:2", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "484:6:2" }, "nodeType": "YulFunctionCall", "src": "484:12:2" }, "nodeType": "YulExpressionStatement", "src": "484:12:2" } ] }, "condition": { "arguments": [ { "arguments": [ { "arguments": [ { "name": "offset", "nodeType": "YulIdentifier", "src": "461:6:2" }, { "kind": "number", "nodeType": "YulLiteral", "src": "469:4:2", "type": "", "value": "0x1f" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "457:3:2" }, "nodeType": "YulFunctionCall", "src": "457:17:2" }, { "name": "end",