From 8521b323829edcff1ee34ca3ed5bf550c3e03568 Mon Sep 17 00:00:00 2001 From: lash Date: Fri, 24 Mar 2023 08:55:59 +0000 Subject: [PATCH] Implement key value option --- .../data/AddressDeclarator.bin | 2 +- .../data/AddressDeclarator.json | 2 +- .../data/AddressDeclarator.metadata.json | 2 +- python/eth_address_declarator/declarator.py | 5 +- python/eth_address_declarator/interface.py | 12 +- .../unittest/addressdeclarator.py | 5 +- python/tests/test_addressdeclarator_kv.py | 262 ++++++++++++++++++ solidity/AddressDeclarator.bin | 2 +- solidity/AddressDeclarator.json | 2 +- solidity/AddressDeclarator.sol | 41 ++- solidity/Makefile | 4 + 11 files changed, 318 insertions(+), 21 deletions(-) create mode 100644 python/tests/test_addressdeclarator_kv.py diff --git a/python/eth_address_declarator/data/AddressDeclarator.bin b/python/eth_address_declarator/data/AddressDeclarator.bin index c63195e..39fd025 100644 --- a/python/eth_address_declarator/data/AddressDeclarator.bin +++ b/python/eth_address_declarator/data/AddressDeclarator.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b506040516200201b3803806200201b833981810160405281019062000037919062000972565b6060600481908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190620000769291906200089f565b50600460016004805490506200008d9190620009dd565b81548110620000a157620000a062000a18565b5b9060005260206000200143409080600181540180825580915050600190039060005260206000200160009091909190915055620000ee3383620000f7640100000000026401000000009004565b50505062000c3d565b600062000103620008f1565b60606000620001233287876200037b640100000000026401000000009004565b9250600160008460006002811062000140576200013f62000a18565b5b6020020151815260200190815260200160002054905060008103620002f357600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906200023c9291906200089f565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480549050620002f09190620009dd565b90505b8060016000856000600281106200030f576200030e62000a18565b5b6020020151815260200190815260200160002081905550600481815481106200033d576200033c62000a18565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b62000385620008f1565b600062000391620008f1565b6000604067ffffffffffffffff811115620003b157620003b062000a47565b5b6040519080825280601f01601f191660200182016040528015620003e45781602001600182028036833780820191505090505b509050620004028787620005f9640100000000026401000000009004565b925060005b6020811015620004a55783816020811062000427576200042662000a18565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811062000460576200045f62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200049c9062000a76565b91505062000407565b5060005b60208110156200055557858160208110620004c957620004c862000a18565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083620004fc919062000ac3565b8151811062000510576200050f62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200054c9062000a76565b915050620004a9565b5082826000600281106200056e576200056d62000a18565b5b60200201818152505060028160405162000589919062000b77565b602060405180830381855afa158015620005a7573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190620005cc919062000972565b82600160028110620005e357620005e262000a18565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff8111156200061c576200061b62000a47565b5b6040519080825280601f01601f1916602001820160405280156200064f5781602001600182028036833780820191505090505b50905060008560405160200162000667919062000c20565b604051602081830303815290604052905060005b601481101562000740578181815181106200069b576200069a62000a18565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838281518110620006fb57620006fa62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620007379062000a76565b9150506200067b565b508460405160200162000754919062000c20565b604051602081830303815290604052905060005b60148110156200083b5781818151811062000788576200078762000a18565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283601483620007e2919062000ac3565b81518110620007f657620007f562000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620008329062000a76565b91505062000768565b506002826040516200084e919062000b77565b602060405180830381855afa1580156200086c573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019062000891919062000972565b925082935050505092915050565b828054828255906000526020600020908101928215620008de579160200282015b82811115620008dd578251825591602001919060010190620008c0565b5b509050620008ed919062000913565b5090565b6040518060400160405280600290602082028036833780820191505090505090565b5b808211156200092e57600081600090555060010162000914565b5090565b600080fd5b6000819050919050565b6200094c8162000937565b81146200095857600080fd5b50565b6000815190506200096c8162000941565b92915050565b6000602082840312156200098b576200098a62000932565b5b60006200099b848285016200095b565b91505092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620009ea82620009a4565b9150620009f783620009a4565b925082820390508181111562000a125762000a11620009ae565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600062000a8382620009a4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362000ab85762000ab7620009ae565b5b600182019050919050565b600062000ad082620009a4565b915062000add83620009a4565b925082820190508082111562000af85762000af7620009ae565b5b92915050565b600081519050919050565b600081905092915050565b60005b8381101562000b3457808201518184015260208101905062000b17565b60008484015250505050565b600062000b4d8262000afe565b62000b59818562000b09565b935062000b6b81856020860162000b14565b80840191505092915050565b600062000b85828462000b40565b915081905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000bbd8262000b90565b9050919050565b60006c0100000000000000000000000082029050919050565b600062000bea8262000bc4565b9050919050565b600062000bfe8262000bdd565b9050919050565b62000c1a62000c148262000bb0565b62000bf1565b82525050565b600062000c2e828462000c05565b60148201915081905092915050565b6113ce8062000c4d6000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c0100000000000000000000000000000000000000000000000000000000900480638c661b36116100785780638c661b361461016a578063ae47ece01461019a578063d0e95db1146101ca578063ff7496b4146101fa576100a5565b806301ffc9a7146100aa57806322168e4f146100da57806350e0c6d31461010a5780637d64bf1d1461013a575b600080fd5b6100c460048036038101906100bf9190610d6a565b61022a565b6040516100d19190610db2565b60405180910390f35b6100f460048036038101906100ef9190610e61565b6102da565b6040516101019190610eb0565b60405180910390f35b610124600480360381019061011f9190610ecb565b61035f565b6040516101319190610f07565b60405180910390f35b610154600480360381019061014f9190610e61565b6103aa565b6040516101619190610eb0565b60405180910390f35b610184600480360381019061017f9190610f22565b610430565b604051610191919061102a565b60405180910390f35b6101b460048036038101906101af9190611078565b6104ce565b6040516101c19190610db2565b60405180910390f35b6101e460048036038101906101df9190610ecb565b610731565b6040516101f19190610f07565b60405180910390f35b610214600480360381019061020f91906110b8565b61077d565b6040516102219190611107565b60405180910390f35b60006327beb9107c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027e57600190506102d5565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102d057600190506102d5565b600090505b919050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061032c5761032b611122565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106103fd576103fc611122565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b606060008061043f85856107ba565b9150600160008381526020019081526020016000205490506004818154811061046b5761046a611122565b5b906000526020600020018054806020026020016040519081016040528092919081815260200182805480156104bf57602002820191906000526020600020905b8154815260200190600101908083116104ab575b50505050509250505092915050565b60006104d8610c81565b606060006104e7328787610a3d565b9250600160008460006002811061050157610500611122565b5b60200201518152602001908152602001600020549050600081036106af57600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906105fa929190610ca3565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506106ac9190611180565b90505b8060016000856000600281106106c8576106c7611122565b5b6020020151815260200190815260200160002081905550600481815481106106f3576106f2611122565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6004828154811061078d57600080fd5b9060005260206000200181815481106107a557600080fd5b90600052602060002001600091509150505481565b6000806000602867ffffffffffffffff8111156107da576107d96111b4565b5b6040519080825280601f01601f19166020018201604052801561080c5781602001600182028036833780820191505090505b5090506000856040516020016108229190611237565b604051602081830303815290604052905060005b60148110156108f15781818151811061085257610851611122565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382815181106108af576108ae611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806108e990611252565b915050610836565b50846040516020016109039190611237565b604051602081830303815290604052905060005b60148110156109de5781818151811061093357610932611122565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028360148361098b919061129a565b8151811061099c5761099b611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806109d690611252565b915050610917565b506002826040516109ef919061133f565b602060405180830381855afa158015610a0c573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a2f919061136b565b925082935050505092915050565b610a45610c81565b6000610a4f610c81565b6000604067ffffffffffffffff811115610a6c57610a6b6111b4565b5b6040519080825280601f01601f191660200182016040528015610a9e5781602001600182028036833780820191505090505b509050610aab87876107ba565b925060005b6020811015610b4457838160208110610acc57610acb611122565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110610b0257610b01611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610b3c90611252565b915050610ab0565b5060005b6020811015610be857858160208110610b6457610b63611122565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083610b95919061129a565b81518110610ba657610ba5611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610be090611252565b915050610b48565b508282600060028110610bfe57610bfd611122565b5b602002018181525050600281604051610c17919061133f565b602060405180830381855afa158015610c34573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610c57919061136b565b82600160028110610c6b57610c6a611122565b5b6020020181815250508193505050509392505050565b6040518060400160405280600290602082028036833780820191505090505090565b828054828255906000526020600020908101928215610cdf579160200282015b82811115610cde578251825591602001919060010190610cc3565b5b509050610cec9190610cf0565b5090565b5b80821115610d09576000816000905550600101610cf1565b5090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d4781610d12565b8114610d5257600080fd5b50565b600081359050610d6481610d3e565b92915050565b600060208284031215610d8057610d7f610d0d565b5b6000610d8e84828501610d55565b91505092915050565b60008115159050919050565b610dac81610d97565b82525050565b6000602082019050610dc76000830184610da3565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610df882610dcd565b9050919050565b610e0881610ded565b8114610e1357600080fd5b50565b600081359050610e2581610dff565b92915050565b6000819050919050565b610e3e81610e2b565b8114610e4957600080fd5b50565b600081359050610e5b81610e35565b92915050565b60008060408385031215610e7857610e77610d0d565b5b6000610e8685828601610e16565b9250506020610e9785828601610e4c565b9150509250929050565b610eaa81610ded565b82525050565b6000602082019050610ec56000830184610ea1565b92915050565b600060208284031215610ee157610ee0610d0d565b5b6000610eef84828501610e16565b91505092915050565b610f0181610e2b565b82525050565b6000602082019050610f1c6000830184610ef8565b92915050565b60008060408385031215610f3957610f38610d0d565b5b6000610f4785828601610e16565b9250506020610f5885828601610e16565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b610fa181610f8e565b82525050565b6000610fb38383610f98565b60208301905092915050565b6000602082019050919050565b6000610fd782610f62565b610fe18185610f6d565b9350610fec83610f7e565b8060005b8381101561101d5781516110048882610fa7565b975061100f83610fbf565b925050600181019050610ff0565b5085935050505092915050565b600060208201905081810360008301526110448184610fcc565b905092915050565b61105581610f8e565b811461106057600080fd5b50565b6000813590506110728161104c565b92915050565b6000806040838503121561108f5761108e610d0d565b5b600061109d85828601610e16565b92505060206110ae85828601611063565b9150509250929050565b600080604083850312156110cf576110ce610d0d565b5b60006110dd85828601610e4c565b92505060206110ee85828601610e4c565b9150509250929050565b61110181610f8e565b82525050565b600060208201905061111c60008301846110f8565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061118b82610e2b565b915061119683610e2b565b92508282039050818111156111ae576111ad611151565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006c0100000000000000000000000082029050919050565b6000611207826111e3565b9050919050565b6000611219826111fc565b9050919050565b61123161122c82610ded565b61120e565b82525050565b60006112438284611220565b60148201915081905092915050565b600061125d82610e2b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361128f5761128e611151565b5b600182019050919050565b60006112a582610e2b565b91506112b083610e2b565b92508282019050808211156112c8576112c7611151565b5b92915050565b600081519050919050565b600081905092915050565b60005b838110156113025780820151818401526020810190506112e7565b60008484015250505050565b6000611319826112ce565b61132381856112d9565b93506113338185602086016112e4565b80840191505092915050565b600061134b828461130e565b915081905092915050565b6000815190506113658161104c565b92915050565b60006020828403121561138157611380610d0d565b5b600061138f84828501611356565b9150509291505056fea26469706673582212207d8b8c843fe83979d66788282a75a2443d2e458d4166243bc94c5c0cca0e55ad64736f6c63430008120033 \ No newline at end of file +60806040523480156200001157600080fd5b50604051620023bd380380620023bd8339818101604052810190620000379190620008d5565b6200005230826200005a640100000000026401000000009004565b505062000ba0565b60006200006662000802565b6060600062000086328787620002de640100000000026401000000009004565b92506001600084600060028110620000a357620000a262000907565b5b60200201518152602001908152602001600020549050600081036200025657600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906200019f92919062000824565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506200025391906200096f565b90505b80600160008560006002811062000272576200027162000907565b5b602002015181526020019081526020016000208190555060048181548110620002a0576200029f62000907565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b620002e862000802565b6000620002f462000802565b6000604067ffffffffffffffff811115620003145762000313620009aa565b5b6040519080825280601f01601f191660200182016040528015620003475781602001600182028036833780820191505090505b5090506200036587876200055c640100000000026401000000009004565b925060005b602081101562000408578381602081106200038a576200038962000907565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110620003c357620003c262000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620003ff90620009d9565b9150506200036a565b5060005b6020811015620004b8578581602081106200042c576200042b62000907565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002826020836200045f919062000a26565b8151811062000473576200047262000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620004af90620009d9565b9150506200040c565b508282600060028110620004d157620004d062000907565b5b602002018181525050600281604051620004ec919062000ada565b602060405180830381855afa1580156200050a573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906200052f9190620008d5565b8260016002811062000546576200054562000907565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff8111156200057f576200057e620009aa565b5b6040519080825280601f01601f191660200182016040528015620005b25781602001600182028036833780820191505090505b509050600085604051602001620005ca919062000b83565b604051602081830303815290604052905060005b6014811015620006a357818181518110620005fe57620005fd62000907565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382815181106200065e576200065d62000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200069a90620009d9565b915050620005de565b5084604051602001620006b7919062000b83565b604051602081830303815290604052905060005b60148110156200079e57818181518110620006eb57620006ea62000907565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028360148362000745919062000a26565b8151811062000759576200075862000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200079590620009d9565b915050620006cb565b50600282604051620007b1919062000ada565b602060405180830381855afa158015620007cf573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190620007f49190620008d5565b925082935050505092915050565b6040518060400160405280600290602082028036833780820191505090505090565b82805482825590600052602060002090810192821562000863579160200282015b828111156200086257825182559160200191906001019062000845565b5b50905062000872919062000876565b5090565b5b808211156200089157600081600090555060010162000877565b5090565b600080fd5b6000819050919050565b620008af816200089a565b8114620008bb57600080fd5b50565b600081519050620008cf81620008a4565b92915050565b600060208284031215620008ee57620008ed62000895565b5b6000620008fe84828501620008be565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200097c8262000936565b9150620009898362000936565b9250828203905081811115620009a457620009a362000940565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000620009e68262000936565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362000a1b5762000a1a62000940565b5b600182019050919050565b600062000a338262000936565b915062000a408362000936565b925082820190508082111562000a5b5762000a5a62000940565b5b92915050565b600081519050919050565b600081905092915050565b60005b8381101562000a9757808201518184015260208101905062000a7a565b60008484015250505050565b600062000ab08262000a61565b62000abc818562000a6c565b935062000ace81856020860162000a77565b80840191505092915050565b600062000ae8828462000aa3565b915081905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000b208262000af3565b9050919050565b60006c0100000000000000000000000082029050919050565b600062000b4d8262000b27565b9050919050565b600062000b618262000b40565b9050919050565b62000b7d62000b778262000b13565b62000b54565b82525050565b600062000b91828462000b68565b60148201915081905092915050565b61180d8062000bb06000396000f3fe608060405234801561001057600080fd5b50600436106100bb576000357c0100000000000000000000000000000000000000000000000000000000900480638c661b36116100835780638c661b36146101b057806390387bab146101e0578063ae47ece014610210578063d0e95db114610240578063ff7496b414610270576100bb565b806301ffc9a7146100c057806322168e4f146100f057806350e0c6d3146101205780636ef498a0146101505780637d64bf1d14610180575b600080fd5b6100da60048036038101906100d59190611103565b6102a0565b6040516100e7919061114b565b60405180910390f35b61010a600480360381019061010591906111fa565b610350565b6040516101179190611249565b60405180910390f35b61013a60048036038101906101359190611264565b6103d5565b60405161014791906112a0565b60405180910390f35b61016a600480360381019061016591906112f1565b610420565b604051610177919061114b565b60405180910390f35b61019a600480360381019061019591906111fa565b610684565b6040516101a79190611249565b60405180910390f35b6101ca60048036038101906101c59190611344565b61070a565b6040516101d79190611442565b60405180910390f35b6101fa60048036038101906101f59190611464565b6107a8565b6040516102079190611442565b60405180910390f35b61022a600480360381019061022591906114b7565b610867565b604051610237919061114b565b60405180910390f35b61025a60048036038101906102559190611264565b610aca565b60405161026791906112a0565b60405180910390f35b61028a600480360381019061028591906114f7565b610b16565b6040516102979190611546565b60405180910390f35b60006327beb9107c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102f4576001905061034b565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610346576001905061034b565b600090505b919050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106103a2576103a1611561565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600061042a61101a565b60606000610439328887610b53565b9250600160008460016002811061045357610452611561565b5b602002015181526020019081526020016000205490506000810361060157600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060048290806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061054c92919061103c565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506105fe91906115bf565b90505b80600160008560016002811061061a57610619611561565b5b60200201518152602001908152602001600020819055506004818154811061064557610644611561565b5b90600052602060002001869080600181540180825580915050600190039060005260206000200160009091909190915055600193505050509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106106d7576106d6611561565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60606000806107198585610d97565b9150600160008381526020019081526020016000205490506004818154811061074557610744611561565b5b9060005260206000200180548060200260200160405190810160405280929190818152602001828054801561079957602002820191906000526020600020905b815481526020019060010190808311610785575b50505050509250505092915050565b60606107b261101a565b60006107bf868686610b53565b915060016000836001600281106107d9576107d8611561565b5b602002015181526020019081526020016000205490506004818154811061080357610802611561565b5b9060005260206000200180548060200260200160405190810160405280929190818152602001828054801561085757602002820191906000526020600020905b815481526020019060010190808311610843575b5050505050925050509392505050565b600061087161101a565b60606000610880328787610b53565b9250600160008460006002811061089a57610899611561565b5b6020020151815260200190815260200160002054905060008103610a4857600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060048290806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061099392919061103c565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480549050610a4591906115bf565b90505b806001600085600060028110610a6157610a60611561565b5b602002015181526020019081526020016000208190555060048181548110610a8c57610a8b611561565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60048281548110610b2657600080fd5b906000526020600020018181548110610b3e57600080fd5b90600052602060002001600091509150505481565b610b5b61101a565b6000610b6561101a565b6000604067ffffffffffffffff811115610b8257610b816115f3565b5b6040519080825280601f01601f191660200182016040528015610bb45781602001600182028036833780820191505090505b509050610bc18787610d97565b925060005b6020811015610c5a57838160208110610be257610be1611561565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110610c1857610c17611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610c5290611622565b915050610bc6565b5060005b6020811015610cfe57858160208110610c7a57610c79611561565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083610cab919061166a565b81518110610cbc57610cbb611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610cf690611622565b915050610c5e565b508282600060028110610d1457610d13611561565b5b602002018181525050600281604051610d2d919061170f565b602060405180830381855afa158015610d4a573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610d6d919061173b565b82600160028110610d8157610d80611561565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff811115610db757610db66115f3565b5b6040519080825280601f01601f191660200182016040528015610de95781602001600182028036833780820191505090505b509050600085604051602001610dff91906117bc565b604051602081830303815290604052905060005b6014811015610ece57818181518110610e2f57610e2e611561565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838281518110610e8c57610e8b611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610ec690611622565b915050610e13565b5084604051602001610ee091906117bc565b604051602081830303815290604052905060005b6014811015610fbb57818181518110610f1057610f0f611561565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283601483610f68919061166a565b81518110610f7957610f78611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610fb390611622565b915050610ef4565b50600282604051610fcc919061170f565b602060405180830381855afa158015610fe9573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061100c919061173b565b925082935050505092915050565b6040518060400160405280600290602082028036833780820191505090505090565b828054828255906000526020600020908101928215611078579160200282015b8281111561107757825182559160200191906001019061105c565b5b5090506110859190611089565b5090565b5b808211156110a257600081600090555060010161108a565b5090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6110e0816110ab565b81146110eb57600080fd5b50565b6000813590506110fd816110d7565b92915050565b600060208284031215611119576111186110a6565b5b6000611127848285016110ee565b91505092915050565b60008115159050919050565b61114581611130565b82525050565b6000602082019050611160600083018461113c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061119182611166565b9050919050565b6111a181611186565b81146111ac57600080fd5b50565b6000813590506111be81611198565b92915050565b6000819050919050565b6111d7816111c4565b81146111e257600080fd5b50565b6000813590506111f4816111ce565b92915050565b60008060408385031215611211576112106110a6565b5b600061121f858286016111af565b9250506020611230858286016111e5565b9150509250929050565b61124381611186565b82525050565b600060208201905061125e600083018461123a565b92915050565b60006020828403121561127a576112796110a6565b5b6000611288848285016111af565b91505092915050565b61129a816111c4565b82525050565b60006020820190506112b56000830184611291565b92915050565b6000819050919050565b6112ce816112bb565b81146112d957600080fd5b50565b6000813590506112eb816112c5565b92915050565b60008060006060848603121561130a576113096110a6565b5b6000611318868287016111af565b9350506020611329868287016112dc565b925050604061133a868287016112dc565b9150509250925092565b6000806040838503121561135b5761135a6110a6565b5b6000611369858286016111af565b925050602061137a858286016111af565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6113b9816112bb565b82525050565b60006113cb83836113b0565b60208301905092915050565b6000602082019050919050565b60006113ef82611384565b6113f9818561138f565b9350611404836113a0565b8060005b8381101561143557815161141c88826113bf565b9750611427836113d7565b925050600181019050611408565b5085935050505092915050565b6000602082019050818103600083015261145c81846113e4565b905092915050565b60008060006060848603121561147d5761147c6110a6565b5b600061148b868287016111af565b935050602061149c868287016111af565b92505060406114ad868287016112dc565b9150509250925092565b600080604083850312156114ce576114cd6110a6565b5b60006114dc858286016111af565b92505060206114ed858286016112dc565b9150509250929050565b6000806040838503121561150e5761150d6110a6565b5b600061151c858286016111e5565b925050602061152d858286016111e5565b9150509250929050565b611540816112bb565b82525050565b600060208201905061155b6000830184611537565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006115ca826111c4565b91506115d5836111c4565b92508282039050818111156115ed576115ec611590565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061162d826111c4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361165f5761165e611590565b5b600182019050919050565b6000611675826111c4565b9150611680836111c4565b925082820190508082111561169857611697611590565b5b92915050565b600081519050919050565b600081905092915050565b60005b838110156116d25780820151818401526020810190506116b7565b60008484015250505050565b60006116e98261169e565b6116f381856116a9565b93506117038185602086016116b4565b80840191505092915050565b600061171b82846116de565b915081905092915050565b600081519050611735816112c5565b92915050565b600060208284031215611751576117506110a6565b5b600061175f84828501611726565b91505092915050565b60006c0100000000000000000000000082029050919050565b600061178c82611768565b9050919050565b600061179e82611781565b9050919050565b6117b66117b182611186565b611793565b82525050565b60006117c882846117a5565b6014820191508190509291505056fea26469706673582212206bc7e365c49e00b27aa9e9d28aa47ce74f4120853db11d1b779da921bd0139ae64736f6c63430008120033 \ No newline at end of file diff --git a/python/eth_address_declarator/data/AddressDeclarator.json b/python/eth_address_declarator/data/AddressDeclarator.json index 5f07419..5e2c9bf 100644 --- a/python/eth_address_declarator/data/AddressDeclarator.json +++ b/python/eth_address_declarator/data/AddressDeclarator.json @@ -1 +1 @@ -[{"inputs":[{"internalType":"bytes32","name":"_initialDescription","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}] +[{"inputs":[{"internalType":"bytes32","name":"_initial","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}] diff --git a/python/eth_address_declarator/data/AddressDeclarator.metadata.json b/python/eth_address_declarator/data/AddressDeclarator.metadata.json index 46b3b8e..2ad41fa 100644 --- a/python/eth_address_declarator/data/AddressDeclarator.metadata.json +++ b/python/eth_address_declarator/data/AddressDeclarator.metadata.json @@ -1 +1 @@ -{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"bytes32","name":"_initialDescription","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"AddressDeclarator.sol":"AddressDeclarator"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"AddressDeclarator.sol":{"keccak256":"0x0d94ef0085d30619c4fc9b9c2d41311b9a09f5c8e97703543bf306fa91ff2d42","license":"GPL-3.0-or-later","urls":["bzz-raw://5c04e0113c939394f4c687c87214f3b1fda3647dbeab5ce49ce7182db5b0d36f","dweb:/ipfs/QmQ5i8JcF1MKNsVsZfwXKuGTJqrn6TJqBBKtpvL885xSL2"]}},"version":1} +{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"bytes32","name":"_initial","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"AddressDeclarator.sol":"AddressDeclarator"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"AddressDeclarator.sol":{"keccak256":"0xd59e4507b7e930e144614da7b67fa9bbeba4bfb3550e8f6dd9f35e2e401187cb","license":"GPL-3.0-or-later","urls":["bzz-raw://8095285849d536e7dc01db9b7cae45928660bacb2f8e6b77f7886a0b8ed4e74b","dweb:/ipfs/QmbvTK75n6tUNj9MarxTVQ6B5kXZgyCpmaz3GFB6tFyXYw"]}},"version":1} diff --git a/python/eth_address_declarator/declarator.py b/python/eth_address_declarator/declarator.py index 707172c..647185f 100644 --- a/python/eth_address_declarator/declarator.py +++ b/python/eth_address_declarator/declarator.py @@ -69,11 +69,10 @@ class AddressDeclarator(Declarator): return 2000000 - def constructor(self, sender_address, initial_description): + def constructor(self, sender_address, description): code = AddressDeclarator.bytecode() enc = ABIContractEncoder() - initial_description_hex = add_0x(initial_description) - enc.bytes32(initial_description_hex) + enc.bytes32(description) code += enc.get() tx = self.template(sender_address, None, use_nonce=True) tx = self.set_code(tx, code) diff --git a/python/eth_address_declarator/interface.py b/python/eth_address_declarator/interface.py index 75409c1..3bc934b 100644 --- a/python/eth_address_declarator/interface.py +++ b/python/eth_address_declarator/interface.py @@ -27,13 +27,17 @@ logg = logging.getLogger(__name__) class Declarator(TxFactory): - def add_declaration(self, contract_address, sender_address, subject_address, proof, tx_format=TxFormat.JSONRPC): + def add_declaration(self, contract_address, sender_address, subject_address, proof, topic=None, tx_format=TxFormat.JSONRPC): enc = ABIContractEncoder() enc.method('addDeclaration') enc.typ(ABIContractType.ADDRESS) enc.typ(ABIContractType.BYTES32) + if topic != None: + enc.typ(ABIContractType.BYTES32) enc.address(subject_address) enc.bytes32(proof) + if topic != None: + enc.bytes32(topic) data = enc.get() tx = self.template(sender_address, contract_address, use_nonce=True) tx = self.set_code(tx, data) @@ -59,7 +63,7 @@ class Declarator(TxFactory): return o - def declaration(self, contract_address, declarator_address, subject_address, sender_address=ZERO_ADDRESS, id_generator=None, height=BlockSpec.LATEST): + def declaration(self, contract_address, declarator_address, subject_address, topic=None, sender_address=ZERO_ADDRESS, id_generator=None, height=BlockSpec.LATEST): j = JSONRPCRequest(id_generator) o = j.template() o['method'] = 'eth_call' @@ -67,8 +71,12 @@ class Declarator(TxFactory): enc.method('declaration') enc.typ(ABIContractType.ADDRESS) enc.typ(ABIContractType.ADDRESS) + if topic != None: + enc.typ(ABIContractType.BYTES32) enc.address(declarator_address) enc.address(subject_address) + if topic != None: + enc.bytes32(topic) data = add_0x(enc.get()) tx = self.template(sender_address, contract_address) tx = self.set_code(tx, data) diff --git a/python/eth_address_declarator/unittest/addressdeclarator.py b/python/eth_address_declarator/unittest/addressdeclarator.py index 05d1ed0..ac44066 100644 --- a/python/eth_address_declarator/unittest/addressdeclarator.py +++ b/python/eth_address_declarator/unittest/addressdeclarator.py @@ -12,6 +12,7 @@ from giftable_erc20_token import GiftableToken # local imports from eth_address_declarator.declarator import AddressDeclarator +from eth_address_declarator.kv import AddressDeclaratorKV logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger() @@ -32,7 +33,7 @@ class TestAddressDeclaratorBase(EthTesterCase): self.assertEqual(r['status'], 1) self.address = r['contract_address'] - logg.debug('address declarator deployed with address {}'.format(self.address)) + logg.debug('address declarator published with address {}'.format(self.address)) c = GiftableToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) (tx_hash_hex, o) = c.constructor(self.accounts[0], 'FooToken', 'FOO', 6) @@ -43,4 +44,4 @@ class TestAddressDeclaratorBase(EthTesterCase): self.assertEqual(r['status'], 1) self.foo_token_address = r['contract_address'] - logg.debug('foo token deployed with address {}'.format(self.foo_token_address)) + logg.debug('foo token published with address {}'.format(self.foo_token_address)) diff --git a/python/tests/test_addressdeclarator_kv.py b/python/tests/test_addressdeclarator_kv.py new file mode 100644 index 0000000..5d85025 --- /dev/null +++ b/python/tests/test_addressdeclarator_kv.py @@ -0,0 +1,262 @@ +# standard imports +import os +import unittest +import json +import logging +import hashlib + +# external imports +from chainlib.eth.unittest.ethtester import EthTesterCase +from chainlib.eth.contract import ( + ABIContractEncoder, + ABIContractType, + ) +from chainlib.eth.nonce import RPCNonceOracle +from chainlib.eth.tx import receipt +from giftable_erc20_token import GiftableToken +from hexathon import ( + add_0x, + strip_0x, + ) + +# local imports +from eth_address_declarator.declarator import AddressDeclarator +from eth_address_declarator import Declarator +from eth_address_declarator.unittest import TestAddressDeclaratorBase + +logging.basicConfig(level=logging.DEBUG) +logg = logging.getLogger() + +testdir = os.path.dirname(__file__) + +description = '0x{:<064s}'.format(b'foo'.hex()) + + +class TestAddressDeclarator(TestAddressDeclaratorBase): + + def setUp(self): + super(TestAddressDeclarator, self).setUp() + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + + #c = GiftableToken(signer=self.signer, nonce_oracle=nonce_oracle, chain_id=self.chain_spec.chain_id()) + c = GiftableToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.constructor(self.accounts[0], 'BarToken', 'BAR', 6) + self.rpc.do(o) + + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + self.bar_token_address = r['contract_address'] + + + def test_basic(self): + k = add_0x(os.urandom(32).hex()) + v = add_0x(os.urandom(32).hex()) + + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[0], self.foo_token_address, v, topic=k) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, v, topic=k) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[0], self.bar_token_address, v, topic=k) + self.rpc.do(o) + + o = c.declarator_count(self.address, self.foo_token_address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(c.parse_declarator_count(r), 2) + + o = c.declarator_count(self.address, self.bar_token_address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(c.parse_declarator_count(r), 1) + + + def test_get_single_declaration(self): + k = add_0x(os.urandom(32).hex()) + v = add_0x(os.urandom(32).hex()) + + nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, v, topic=k) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + o = c.declaration(self.address, self.accounts[1], self.foo_token_address, topic=k, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(strip_0x(r)[128:], strip_0x(v)) + + + def test_kv_declarations(self): + + k = add_0x(os.urandom(32).hex()) + v = add_0x(os.urandom(32).hex()) + w = add_0x(os.urandom(32).hex()) + + k_two = add_0x(os.urandom(32).hex()) + v_two = add_0x(os.urandom(32).hex()) + + nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, v, topic=k) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) + c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, w, topic=k) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, v_two, topic=k_two) + self.rpc.do(o) + o = receipt(tx_hash_hex) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) +# nonce_oracle = RPCNonceOracle(self.accounts[2], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[2], self.foo_token_address, k, v) +# self.rpc.do(o) +# +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[2], self.bar_token_address, k, v) +# self.rpc.do(o) + + o = c.declaration(self.address, self.accounts[1], self.foo_token_address, topic=k, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(strip_0x(r)[128:], strip_0x(v) + strip_0x(w)) + + o = c.declaration(self.address, self.accounts[1], self.foo_token_address, topic=k_two, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(strip_0x(r)[128:], strip_0x(v_two)) + + +# def test_declarator_to_subject(self): +# d = add_0x(os.urandom(32).hex()) +# +# nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, d) +# self.rpc.do(o) +# +# nonce_oracle = RPCNonceOracle(self.accounts[2], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[2], self.foo_token_address, d) +# self.rpc.do(o) +# +# nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.bar_token_address, d) +# self.rpc.do(o) +# +# o = c.declaration_address_at(self.address, self.accounts[1], 0, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declaration_address_at(r), strip_0x(self.foo_token_address)) +# +# o = c.declaration_address_at(self.address, self.accounts[2], 0, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declaration_address_at(r), strip_0x(self.foo_token_address)) +# +# o = c.declaration_address_at(self.address, self.accounts[1], 1, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declaration_address_at(r), strip_0x(self.bar_token_address)) +# +# +# def test_subject_to_declarator(self): +# d = '0x' + os.urandom(32).hex() +# +# nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.foo_token_address, d) +# self.rpc.do(o) +# +# nonce_oracle = RPCNonceOracle(self.accounts[2], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[2], self.foo_token_address, d) +# self.rpc.do(o) +# +# nonce_oracle = RPCNonceOracle(self.accounts[1], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[1], self.bar_token_address, d) +# self.rpc.do(o) +# +# o = c.declarator_address_at(self.address, self.foo_token_address, 0, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declaration_address_at(r), strip_0x(self.accounts[1])) +# +# o = c.declarator_address_at(self.address, self.foo_token_address, 1, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declaration_address_at(r), strip_0x(self.accounts[2])) +# +# +# def test_three_first(self): +# d = [] +# for i in range(3): +# d.append(add_0x(os.urandom(32).hex())) +# +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# for proof in d: +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[0], self.foo_token_address, proof) +# self.rpc.do(o) +# +# o = c.declarator_count(self.address, self.foo_token_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declarator_count(r), 1) +# +# o = c.declaration(self.address, self.accounts[0], self.foo_token_address, sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# proofs = c.parse_declaration(r) +# self.assertEqual(len(proofs), 3) +# +# for i in range(3): +# self.assertEqual(proofs[i], strip_0x(d[i])) +# +# +# def test_three_first_different(self): +# d = [] +# a = [] +# for i in range(3): +# d.append(add_0x(os.urandom(32).hex())) +# a.append(add_0x(os.urandom(20).hex())) +# +# nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) +# c = Declarator(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) +# +# for i in range(3): +# (tx_hash_hex, o) = c.add_declaration(self.address, self.accounts[0], a[i], d[i]) +# self.rpc.do(o) +# +# for i in range(3): +# o = c.declarator_count(self.address, a[i], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# self.assertEqual(c.parse_declarator_count(r), 1) +# +# o = c.declaration(self.address, self.accounts[0], a[i], sender_address=self.accounts[0]) +# r = self.rpc.do(o) +# proofs = c.parse_declaration(r) +# self.assertEqual(len(proofs), 1) +# self.assertEqual(proofs[0], strip_0x(d[i])) + + +if __name__ == '__main__': + unittest.main() diff --git a/solidity/AddressDeclarator.bin b/solidity/AddressDeclarator.bin index c63195e..39fd025 100644 --- a/solidity/AddressDeclarator.bin +++ b/solidity/AddressDeclarator.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b506040516200201b3803806200201b833981810160405281019062000037919062000972565b6060600481908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190620000769291906200089f565b50600460016004805490506200008d9190620009dd565b81548110620000a157620000a062000a18565b5b9060005260206000200143409080600181540180825580915050600190039060005260206000200160009091909190915055620000ee3383620000f7640100000000026401000000009004565b50505062000c3d565b600062000103620008f1565b60606000620001233287876200037b640100000000026401000000009004565b9250600160008460006002811062000140576200013f62000a18565b5b6020020151815260200190815260200160002054905060008103620002f357600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906200023c9291906200089f565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480549050620002f09190620009dd565b90505b8060016000856000600281106200030f576200030e62000a18565b5b6020020151815260200190815260200160002081905550600481815481106200033d576200033c62000a18565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b62000385620008f1565b600062000391620008f1565b6000604067ffffffffffffffff811115620003b157620003b062000a47565b5b6040519080825280601f01601f191660200182016040528015620003e45781602001600182028036833780820191505090505b509050620004028787620005f9640100000000026401000000009004565b925060005b6020811015620004a55783816020811062000427576200042662000a18565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811062000460576200045f62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200049c9062000a76565b91505062000407565b5060005b60208110156200055557858160208110620004c957620004c862000a18565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083620004fc919062000ac3565b8151811062000510576200050f62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200054c9062000a76565b915050620004a9565b5082826000600281106200056e576200056d62000a18565b5b60200201818152505060028160405162000589919062000b77565b602060405180830381855afa158015620005a7573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190620005cc919062000972565b82600160028110620005e357620005e262000a18565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff8111156200061c576200061b62000a47565b5b6040519080825280601f01601f1916602001820160405280156200064f5781602001600182028036833780820191505090505b50905060008560405160200162000667919062000c20565b604051602081830303815290604052905060005b601481101562000740578181815181106200069b576200069a62000a18565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838281518110620006fb57620006fa62000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620007379062000a76565b9150506200067b565b508460405160200162000754919062000c20565b604051602081830303815290604052905060005b60148110156200083b5781818151811062000788576200078762000a18565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283601483620007e2919062000ac3565b81518110620007f657620007f562000a18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620008329062000a76565b91505062000768565b506002826040516200084e919062000b77565b602060405180830381855afa1580156200086c573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019062000891919062000972565b925082935050505092915050565b828054828255906000526020600020908101928215620008de579160200282015b82811115620008dd578251825591602001919060010190620008c0565b5b509050620008ed919062000913565b5090565b6040518060400160405280600290602082028036833780820191505090505090565b5b808211156200092e57600081600090555060010162000914565b5090565b600080fd5b6000819050919050565b6200094c8162000937565b81146200095857600080fd5b50565b6000815190506200096c8162000941565b92915050565b6000602082840312156200098b576200098a62000932565b5b60006200099b848285016200095b565b91505092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620009ea82620009a4565b9150620009f783620009a4565b925082820390508181111562000a125762000a11620009ae565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600062000a8382620009a4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362000ab85762000ab7620009ae565b5b600182019050919050565b600062000ad082620009a4565b915062000add83620009a4565b925082820190508082111562000af85762000af7620009ae565b5b92915050565b600081519050919050565b600081905092915050565b60005b8381101562000b3457808201518184015260208101905062000b17565b60008484015250505050565b600062000b4d8262000afe565b62000b59818562000b09565b935062000b6b81856020860162000b14565b80840191505092915050565b600062000b85828462000b40565b915081905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000bbd8262000b90565b9050919050565b60006c0100000000000000000000000082029050919050565b600062000bea8262000bc4565b9050919050565b600062000bfe8262000bdd565b9050919050565b62000c1a62000c148262000bb0565b62000bf1565b82525050565b600062000c2e828462000c05565b60148201915081905092915050565b6113ce8062000c4d6000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c0100000000000000000000000000000000000000000000000000000000900480638c661b36116100785780638c661b361461016a578063ae47ece01461019a578063d0e95db1146101ca578063ff7496b4146101fa576100a5565b806301ffc9a7146100aa57806322168e4f146100da57806350e0c6d31461010a5780637d64bf1d1461013a575b600080fd5b6100c460048036038101906100bf9190610d6a565b61022a565b6040516100d19190610db2565b60405180910390f35b6100f460048036038101906100ef9190610e61565b6102da565b6040516101019190610eb0565b60405180910390f35b610124600480360381019061011f9190610ecb565b61035f565b6040516101319190610f07565b60405180910390f35b610154600480360381019061014f9190610e61565b6103aa565b6040516101619190610eb0565b60405180910390f35b610184600480360381019061017f9190610f22565b610430565b604051610191919061102a565b60405180910390f35b6101b460048036038101906101af9190611078565b6104ce565b6040516101c19190610db2565b60405180910390f35b6101e460048036038101906101df9190610ecb565b610731565b6040516101f19190610f07565b60405180910390f35b610214600480360381019061020f91906110b8565b61077d565b6040516102219190611107565b60405180910390f35b60006327beb9107c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027e57600190506102d5565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102d057600190506102d5565b600090505b919050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061032c5761032b611122565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106103fd576103fc611122565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b606060008061043f85856107ba565b9150600160008381526020019081526020016000205490506004818154811061046b5761046a611122565b5b906000526020600020018054806020026020016040519081016040528092919081815260200182805480156104bf57602002820191906000526020600020905b8154815260200190600101908083116104ab575b50505050509250505092915050565b60006104d8610c81565b606060006104e7328787610a3d565b9250600160008460006002811061050157610500611122565b5b60200201518152602001908152602001600020549050600081036106af57600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906105fa929190610ca3565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506106ac9190611180565b90505b8060016000856000600281106106c8576106c7611122565b5b6020020151815260200190815260200160002081905550600481815481106106f3576106f2611122565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6004828154811061078d57600080fd5b9060005260206000200181815481106107a557600080fd5b90600052602060002001600091509150505481565b6000806000602867ffffffffffffffff8111156107da576107d96111b4565b5b6040519080825280601f01601f19166020018201604052801561080c5781602001600182028036833780820191505090505b5090506000856040516020016108229190611237565b604051602081830303815290604052905060005b60148110156108f15781818151811061085257610851611122565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382815181106108af576108ae611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806108e990611252565b915050610836565b50846040516020016109039190611237565b604051602081830303815290604052905060005b60148110156109de5781818151811061093357610932611122565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028360148361098b919061129a565b8151811061099c5761099b611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806109d690611252565b915050610917565b506002826040516109ef919061133f565b602060405180830381855afa158015610a0c573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a2f919061136b565b925082935050505092915050565b610a45610c81565b6000610a4f610c81565b6000604067ffffffffffffffff811115610a6c57610a6b6111b4565b5b6040519080825280601f01601f191660200182016040528015610a9e5781602001600182028036833780820191505090505b509050610aab87876107ba565b925060005b6020811015610b4457838160208110610acc57610acb611122565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110610b0257610b01611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610b3c90611252565b915050610ab0565b5060005b6020811015610be857858160208110610b6457610b63611122565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083610b95919061129a565b81518110610ba657610ba5611122565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610be090611252565b915050610b48565b508282600060028110610bfe57610bfd611122565b5b602002018181525050600281604051610c17919061133f565b602060405180830381855afa158015610c34573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610c57919061136b565b82600160028110610c6b57610c6a611122565b5b6020020181815250508193505050509392505050565b6040518060400160405280600290602082028036833780820191505090505090565b828054828255906000526020600020908101928215610cdf579160200282015b82811115610cde578251825591602001919060010190610cc3565b5b509050610cec9190610cf0565b5090565b5b80821115610d09576000816000905550600101610cf1565b5090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d4781610d12565b8114610d5257600080fd5b50565b600081359050610d6481610d3e565b92915050565b600060208284031215610d8057610d7f610d0d565b5b6000610d8e84828501610d55565b91505092915050565b60008115159050919050565b610dac81610d97565b82525050565b6000602082019050610dc76000830184610da3565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610df882610dcd565b9050919050565b610e0881610ded565b8114610e1357600080fd5b50565b600081359050610e2581610dff565b92915050565b6000819050919050565b610e3e81610e2b565b8114610e4957600080fd5b50565b600081359050610e5b81610e35565b92915050565b60008060408385031215610e7857610e77610d0d565b5b6000610e8685828601610e16565b9250506020610e9785828601610e4c565b9150509250929050565b610eaa81610ded565b82525050565b6000602082019050610ec56000830184610ea1565b92915050565b600060208284031215610ee157610ee0610d0d565b5b6000610eef84828501610e16565b91505092915050565b610f0181610e2b565b82525050565b6000602082019050610f1c6000830184610ef8565b92915050565b60008060408385031215610f3957610f38610d0d565b5b6000610f4785828601610e16565b9250506020610f5885828601610e16565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b610fa181610f8e565b82525050565b6000610fb38383610f98565b60208301905092915050565b6000602082019050919050565b6000610fd782610f62565b610fe18185610f6d565b9350610fec83610f7e565b8060005b8381101561101d5781516110048882610fa7565b975061100f83610fbf565b925050600181019050610ff0565b5085935050505092915050565b600060208201905081810360008301526110448184610fcc565b905092915050565b61105581610f8e565b811461106057600080fd5b50565b6000813590506110728161104c565b92915050565b6000806040838503121561108f5761108e610d0d565b5b600061109d85828601610e16565b92505060206110ae85828601611063565b9150509250929050565b600080604083850312156110cf576110ce610d0d565b5b60006110dd85828601610e4c565b92505060206110ee85828601610e4c565b9150509250929050565b61110181610f8e565b82525050565b600060208201905061111c60008301846110f8565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061118b82610e2b565b915061119683610e2b565b92508282039050818111156111ae576111ad611151565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006c0100000000000000000000000082029050919050565b6000611207826111e3565b9050919050565b6000611219826111fc565b9050919050565b61123161122c82610ded565b61120e565b82525050565b60006112438284611220565b60148201915081905092915050565b600061125d82610e2b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361128f5761128e611151565b5b600182019050919050565b60006112a582610e2b565b91506112b083610e2b565b92508282019050808211156112c8576112c7611151565b5b92915050565b600081519050919050565b600081905092915050565b60005b838110156113025780820151818401526020810190506112e7565b60008484015250505050565b6000611319826112ce565b61132381856112d9565b93506113338185602086016112e4565b80840191505092915050565b600061134b828461130e565b915081905092915050565b6000815190506113658161104c565b92915050565b60006020828403121561138157611380610d0d565b5b600061138f84828501611356565b9150509291505056fea26469706673582212207d8b8c843fe83979d66788282a75a2443d2e458d4166243bc94c5c0cca0e55ad64736f6c63430008120033 \ No newline at end of file +60806040523480156200001157600080fd5b50604051620023bd380380620023bd8339818101604052810190620000379190620008d5565b6200005230826200005a640100000000026401000000009004565b505062000ba0565b60006200006662000802565b6060600062000086328787620002de640100000000026401000000009004565b92506001600084600060028110620000a357620000a262000907565b5b60200201518152602001908152602001600020549050600081036200025657600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004829080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906200019f92919062000824565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506200025391906200096f565b90505b80600160008560006002811062000272576200027162000907565b5b602002015181526020019081526020016000208190555060048181548110620002a0576200029f62000907565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b620002e862000802565b6000620002f462000802565b6000604067ffffffffffffffff811115620003145762000313620009aa565b5b6040519080825280601f01601f191660200182016040528015620003475781602001600182028036833780820191505090505b5090506200036587876200055c640100000000026401000000009004565b925060005b602081101562000408578381602081106200038a576200038962000907565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110620003c357620003c262000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620003ff90620009d9565b9150506200036a565b5060005b6020811015620004b8578581602081106200042c576200042b62000907565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002826020836200045f919062000a26565b8151811062000473576200047262000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620004af90620009d9565b9150506200040c565b508282600060028110620004d157620004d062000907565b5b602002018181525050600281604051620004ec919062000ada565b602060405180830381855afa1580156200050a573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906200052f9190620008d5565b8260016002811062000546576200054562000907565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff8111156200057f576200057e620009aa565b5b6040519080825280601f01601f191660200182016040528015620005b25781602001600182028036833780820191505090505b509050600085604051602001620005ca919062000b83565b604051602081830303815290604052905060005b6014811015620006a357818181518110620005fe57620005fd62000907565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382815181106200065e576200065d62000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200069a90620009d9565b915050620005de565b5084604051602001620006b7919062000b83565b604051602081830303815290604052905060005b60148110156200079e57818181518110620006eb57620006ea62000907565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028360148362000745919062000a26565b8151811062000759576200075862000907565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200079590620009d9565b915050620006cb565b50600282604051620007b1919062000ada565b602060405180830381855afa158015620007cf573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190620007f49190620008d5565b925082935050505092915050565b6040518060400160405280600290602082028036833780820191505090505090565b82805482825590600052602060002090810192821562000863579160200282015b828111156200086257825182559160200191906001019062000845565b5b50905062000872919062000876565b5090565b5b808211156200089157600081600090555060010162000877565b5090565b600080fd5b6000819050919050565b620008af816200089a565b8114620008bb57600080fd5b50565b600081519050620008cf81620008a4565b92915050565b600060208284031215620008ee57620008ed62000895565b5b6000620008fe84828501620008be565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006200097c8262000936565b9150620009898362000936565b9250828203905081811115620009a457620009a362000940565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000620009e68262000936565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362000a1b5762000a1a62000940565b5b600182019050919050565b600062000a338262000936565b915062000a408362000936565b925082820190508082111562000a5b5762000a5a62000940565b5b92915050565b600081519050919050565b600081905092915050565b60005b8381101562000a9757808201518184015260208101905062000a7a565b60008484015250505050565b600062000ab08262000a61565b62000abc818562000a6c565b935062000ace81856020860162000a77565b80840191505092915050565b600062000ae8828462000aa3565b915081905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000b208262000af3565b9050919050565b60006c0100000000000000000000000082029050919050565b600062000b4d8262000b27565b9050919050565b600062000b618262000b40565b9050919050565b62000b7d62000b778262000b13565b62000b54565b82525050565b600062000b91828462000b68565b60148201915081905092915050565b61180d8062000bb06000396000f3fe608060405234801561001057600080fd5b50600436106100bb576000357c0100000000000000000000000000000000000000000000000000000000900480638c661b36116100835780638c661b36146101b057806390387bab146101e0578063ae47ece014610210578063d0e95db114610240578063ff7496b414610270576100bb565b806301ffc9a7146100c057806322168e4f146100f057806350e0c6d3146101205780636ef498a0146101505780637d64bf1d14610180575b600080fd5b6100da60048036038101906100d59190611103565b6102a0565b6040516100e7919061114b565b60405180910390f35b61010a600480360381019061010591906111fa565b610350565b6040516101179190611249565b60405180910390f35b61013a60048036038101906101359190611264565b6103d5565b60405161014791906112a0565b60405180910390f35b61016a600480360381019061016591906112f1565b610420565b604051610177919061114b565b60405180910390f35b61019a600480360381019061019591906111fa565b610684565b6040516101a79190611249565b60405180910390f35b6101ca60048036038101906101c59190611344565b61070a565b6040516101d79190611442565b60405180910390f35b6101fa60048036038101906101f59190611464565b6107a8565b6040516102079190611442565b60405180910390f35b61022a600480360381019061022591906114b7565b610867565b604051610237919061114b565b60405180910390f35b61025a60048036038101906102559190611264565b610aca565b60405161026791906112a0565b60405180910390f35b61028a600480360381019061028591906114f7565b610b16565b6040516102979190611546565b60405180910390f35b60006327beb9107c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102f4576001905061034b565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610346576001905061034b565b600090505b919050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106103a2576103a1611561565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600061042a61101a565b60606000610439328887610b53565b9250600160008460016002811061045357610452611561565b5b602002015181526020019081526020016000205490506000810361060157600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060048290806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061054c92919061103c565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506105fe91906115bf565b90505b80600160008560016002811061061a57610619611561565b5b60200201518152602001908152602001600020819055506004818154811061064557610644611561565b5b90600052602060002001869080600181540180825580915050600190039060005260206000200160009091909190915055600193505050509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106106d7576106d6611561565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60606000806107198585610d97565b9150600160008381526020019081526020016000205490506004818154811061074557610744611561565b5b9060005260206000200180548060200260200160405190810160405280929190818152602001828054801561079957602002820191906000526020600020905b815481526020019060010190808311610785575b50505050509250505092915050565b60606107b261101a565b60006107bf868686610b53565b915060016000836001600281106107d9576107d8611561565b5b602002015181526020019081526020016000205490506004818154811061080357610802611561565b5b9060005260206000200180548060200260200160405190810160405280929190818152602001828054801561085757602002820191906000526020600020905b815481526020019060010190808311610843575b5050505050925050509392505050565b600061087161101a565b60606000610880328787610b53565b9250600160008460006002811061089a57610899611561565b5b6020020151815260200190815260200160002054905060008103610a4857600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020329080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060048290806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061099392919061103c565b506000803273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020869080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480549050610a4591906115bf565b90505b806001600085600060028110610a6157610a60611561565b5b602002015181526020019081526020016000208190555060048181548110610a8c57610a8b611561565b5b906000526020600020018590806001815401808255809150506001900390600052602060002001600090919091909150556001935050505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60048281548110610b2657600080fd5b906000526020600020018181548110610b3e57600080fd5b90600052602060002001600091509150505481565b610b5b61101a565b6000610b6561101a565b6000604067ffffffffffffffff811115610b8257610b816115f3565b5b6040519080825280601f01601f191660200182016040528015610bb45781602001600182028036833780820191505090505b509050610bc18787610d97565b925060005b6020811015610c5a57838160208110610be257610be1611561565b5b1a7f010000000000000000000000000000000000000000000000000000000000000002828281518110610c1857610c17611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610c5290611622565b915050610bc6565b5060005b6020811015610cfe57858160208110610c7a57610c79611561565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282602083610cab919061166a565b81518110610cbc57610cbb611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610cf690611622565b915050610c5e565b508282600060028110610d1457610d13611561565b5b602002018181525050600281604051610d2d919061170f565b602060405180830381855afa158015610d4a573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610d6d919061173b565b82600160028110610d8157610d80611561565b5b6020020181815250508193505050509392505050565b6000806000602867ffffffffffffffff811115610db757610db66115f3565b5b6040519080825280601f01601f191660200182016040528015610de95781602001600182028036833780820191505090505b509050600085604051602001610dff91906117bc565b604051602081830303815290604052905060005b6014811015610ece57818181518110610e2f57610e2e611561565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838281518110610e8c57610e8b611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610ec690611622565b915050610e13565b5084604051602001610ee091906117bc565b604051602081830303815290604052905060005b6014811015610fbb57818181518110610f1057610f0f611561565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000283601483610f68919061166a565b81518110610f7957610f78611561565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610fb390611622565b915050610ef4565b50600282604051610fcc919061170f565b602060405180830381855afa158015610fe9573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061100c919061173b565b925082935050505092915050565b6040518060400160405280600290602082028036833780820191505090505090565b828054828255906000526020600020908101928215611078579160200282015b8281111561107757825182559160200191906001019061105c565b5b5090506110859190611089565b5090565b5b808211156110a257600081600090555060010161108a565b5090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6110e0816110ab565b81146110eb57600080fd5b50565b6000813590506110fd816110d7565b92915050565b600060208284031215611119576111186110a6565b5b6000611127848285016110ee565b91505092915050565b60008115159050919050565b61114581611130565b82525050565b6000602082019050611160600083018461113c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061119182611166565b9050919050565b6111a181611186565b81146111ac57600080fd5b50565b6000813590506111be81611198565b92915050565b6000819050919050565b6111d7816111c4565b81146111e257600080fd5b50565b6000813590506111f4816111ce565b92915050565b60008060408385031215611211576112106110a6565b5b600061121f858286016111af565b9250506020611230858286016111e5565b9150509250929050565b61124381611186565b82525050565b600060208201905061125e600083018461123a565b92915050565b60006020828403121561127a576112796110a6565b5b6000611288848285016111af565b91505092915050565b61129a816111c4565b82525050565b60006020820190506112b56000830184611291565b92915050565b6000819050919050565b6112ce816112bb565b81146112d957600080fd5b50565b6000813590506112eb816112c5565b92915050565b60008060006060848603121561130a576113096110a6565b5b6000611318868287016111af565b9350506020611329868287016112dc565b925050604061133a868287016112dc565b9150509250925092565b6000806040838503121561135b5761135a6110a6565b5b6000611369858286016111af565b925050602061137a858286016111af565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6113b9816112bb565b82525050565b60006113cb83836113b0565b60208301905092915050565b6000602082019050919050565b60006113ef82611384565b6113f9818561138f565b9350611404836113a0565b8060005b8381101561143557815161141c88826113bf565b9750611427836113d7565b925050600181019050611408565b5085935050505092915050565b6000602082019050818103600083015261145c81846113e4565b905092915050565b60008060006060848603121561147d5761147c6110a6565b5b600061148b868287016111af565b935050602061149c868287016111af565b92505060406114ad868287016112dc565b9150509250925092565b600080604083850312156114ce576114cd6110a6565b5b60006114dc858286016111af565b92505060206114ed858286016112dc565b9150509250929050565b6000806040838503121561150e5761150d6110a6565b5b600061151c858286016111e5565b925050602061152d858286016111e5565b9150509250929050565b611540816112bb565b82525050565b600060208201905061155b6000830184611537565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006115ca826111c4565b91506115d5836111c4565b92508282039050818111156115ed576115ec611590565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061162d826111c4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361165f5761165e611590565b5b600182019050919050565b6000611675826111c4565b9150611680836111c4565b925082820190508082111561169857611697611590565b5b92915050565b600081519050919050565b600081905092915050565b60005b838110156116d25780820151818401526020810190506116b7565b60008484015250505050565b60006116e98261169e565b6116f381856116a9565b93506117038185602086016116b4565b80840191505092915050565b600061171b82846116de565b915081905092915050565b600081519050611735816112c5565b92915050565b600060208284031215611751576117506110a6565b5b600061175f84828501611726565b91505092915050565b60006c0100000000000000000000000082029050919050565b600061178c82611768565b9050919050565b600061179e82611781565b9050919050565b6117b66117b182611186565b611793565b82525050565b60006117c882846117a5565b6014820191508190509291505056fea26469706673582212206bc7e365c49e00b27aa9e9d28aa47ce74f4120853db11d1b779da921bd0139ae64736f6c63430008120033 \ No newline at end of file diff --git a/solidity/AddressDeclarator.json b/solidity/AddressDeclarator.json index 5f07419..5e2c9bf 100644 --- a/solidity/AddressDeclarator.json +++ b/solidity/AddressDeclarator.json @@ -1 +1 @@ -[{"inputs":[{"internalType":"bytes32","name":"_initialDescription","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}] +[{"inputs":[{"internalType":"bytes32","name":"_initial","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}] diff --git a/solidity/AddressDeclarator.sol b/solidity/AddressDeclarator.sol index 4d62b4d..affe640 100644 --- a/solidity/AddressDeclarator.sol +++ b/solidity/AddressDeclarator.sol @@ -12,16 +12,10 @@ contract AddressDeclarator { event DeclarationAdded(address _declarator, address _subject, bytes32 _proof); - constructor(bytes32 _initialDescription) { - bytes32[] memory foundation; - - contents.push(foundation); - contents[contents.length-1].push(blockhash(block.number)); - - addDeclaration(msg.sender, _initialDescription); - + constructor(bytes32 _initial) { + addDeclaration(address(this), _initial); } - + function toReference(address _declarator, address _subject) private pure returns ( bytes32 ) { bytes32 k; bytes memory addrMaterial = new bytes(40); @@ -66,6 +60,26 @@ contract AddressDeclarator { return declarator[_subject][_idx]; } + // Implements Declarator + function addDeclaration(address _subject, bytes32 _proof, bytes32 _topic) public returns ( bool ) { + bytes32[2] memory ks; + bytes32[] memory declarationContents; + uint256 idx; + ks = toReference(tx.origin, _subject, _topic); + idx = declarationContentIndex[ks[1]]; + if (idx == 0) { // This also works for the constructor :) + declarator[_subject].push(tx.origin); + contents.push(declarationContents); + declarationIndex[tx.origin].push(_subject); + idx = contents.length-1; + } + + declarationContentIndex[ks[1]] = idx; + contents[idx].push(_proof); + + return true; + } + // Implements Declarator function addDeclaration(address _subject, bytes32 _proof) public returns ( bool ) { bytes32[2] memory ks; @@ -95,6 +109,15 @@ contract AddressDeclarator { return contents[idx]; } + // Implements Declarator + function declaration(address _declarator, address _subject, bytes32 _topic) public view returns ( bytes32[] memory ) { + bytes32[2] memory k; + uint256 idx; + k = toReference(_declarator, _subject, _topic); + idx = declarationContentIndex[k[1]]; + return contents[idx]; + } + // Implements Declarator function declarationCount(address _declarator) public view returns ( uint256 ) { return declarationIndex[_declarator].length; diff --git a/solidity/Makefile b/solidity/Makefile index f10369b..8a29b3b 100644 --- a/solidity/Makefile +++ b/solidity/Makefile @@ -7,7 +7,11 @@ address_declarator: $(SOLC) AddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > AddressDeclarator.json $(SOLC) AddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > AddressDeclarator.bin $(SOLC) AddressDeclarator.sol --metadata --evm-version byzantium | awk 'NR>3' > AddressDeclarator.metadata.json + #$(SOLC) AddressDeclaratorKV.sol --abi --evm-version byzantium | awk 'NR>3' > AddressDeclaratorKV.json + #$(SOLC) AddressDeclaratorKV.sol --bin --evm-version byzantium | awk 'NR>3' > AddressDeclaratorKV.bin + #$(SOLC) AddressDeclaratorKV.sol --metadata --evm-version byzantium | awk 'NR>3' > AddressDeclaratorKV.metadata.json truncate -s -1 AddressDeclarator.bin + #truncate -s -1 AddressDeclaratorKV.bin #token_index: # $(SOLC) TokenUniqueSymbolIndexAddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > TokenUniqueSymbolIndexAddressDeclarator.json