eth-accounts-index

Accounts index evm contract tooling with permissioned writes
Log | Files | Refs

commit 3053e8312fb07c82c78bc7c02db680c95bb9e1c2
parent 7042e5c73e2f76e9fc8f72f3a559c53a191cf263
Author: lash <dev@holbrook.no>
Date:   Tue, 21 Mar 2023 13:26:55 +0000

Implement writer interface correct

Diffstat:
Mpython/eth_accounts_index/data/AccountsIndex.bin | 4++--
Mpython/eth_accounts_index/data/AccountsIndex.json | 2+-
Msolidity/AccountsIndex.sol | 18+++++++++++-------
3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/python/eth_accounts_index/data/AccountsIndex.bin b/python/eth_accounts_index/data/AccountsIndex.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b5033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061165c806100c36000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c0100000000000000000000000000000000000000000000000000000000900480635ae06f7e116100b4578063da2824a811610083578063da2824a814610303578063e0db665b14610333578063e2095c0714610363578063f2fde38b1461039357610112565b80635ae06f7e146102555780637c67a3e2146102855780638da5cb5b146102b55780639f8a13d7146102d357610112565b80631c5a9d9c116100f05780631c5a9d9c1461019557806329092d0e146101c55780633ea053eb146101f55780633ef250131461022557610112565b806301ffc9a7146101175780630a3b0a4f146101475780630cbb0f8314610177575b600080fd5b610131600480360381019061012c9190611333565b6103c3565b60405161013e919061137b565b60405180910390f35b610161600480360381019061015c91906113f4565b610517565b60405161016e919061137b565b60405180910390f35b61017f6106f9565b60405161018c919061143a565b60405180910390f35b6101af60048036038101906101aa91906113f4565b610712565b6040516101bc919061137b565b60405180910390f35b6101df60048036038101906101da91906113f4565b6108c1565b6040516101ec919061137b565b60405180910390f35b61020f600480360381019061020a91906113f4565b610b9a565b60405161021c919061137b565b60405180910390f35b61023f600480360381019061023a91906113f4565b610da3565b60405161024c919061137b565b60405180910390f35b61026f600480360381019061026a91906113f4565b610dee565b60405161027c919061137b565b60405180910390f35b61029f600480360381019061029a91906113f4565b610ea2565b6040516102ac919061143a565b60405180910390f35b6102bd610f42565b6040516102ca9190611464565b60405180910390f35b6102ed60048036038101906102e891906113f4565b610f68565b6040516102fa919061137b565b60405180910390f35b61031d600480360381019061031891906113f4565b611065565b60405161032a919061137b565b60405180910390f35b61034d600480360381019061034891906113f4565b611122565b60405161035a919061143a565b60405180910390f35b61037d600480360381019061037891906114ab565b61113a565b60405161038a9190611464565b60405180910390f35b6103ad60048036038101906103a891906113f4565b61118d565b6040516103ba919061137b565b60405180910390f35b600063cbdb05c77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104175760019050610512565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104695760019050610512565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104bb5760019050610512565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361050d5760019050610512565b600090505b919050565b6000806000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661057257600080fd5b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146105be57600080fd5b68010000000000000000600080549050106105d857600080fd5b60008054905091506000849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508167ffffffffffffffff1690506040429060020a028117905080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f0e0a4bee74426fd0767a5c0887f18db17207090abad67f13ae982a18a000e3d7856040516106e69190611464565b60405180910390a2600192505050919050565b6000600160008054905061070d9190611507565b905090565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661076a57600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561080a575070010000000000000000000000000000000080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205416145b61081357600080fd5b6081600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254908060020a8204915050925050819055503373ffffffffffffffffffffffffffffffffffffffff167fa27913ebf7f29594798a64cfe7cabb550ef9670075e217c2f4c1e532a899baea836040516108b09190611464565b60405180910390a260019050919050565b6000806000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661091c57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16633ef25013856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016109719190611464565b602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b29190611567565b6109bb57600080fd5b60016000805490506109cd9190611507565b9050600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915080821015610ab55760008181548110610a2d57610a2c611594565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008381548110610a6c57610a6b611594565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000805480610ac757610ac66115c3565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f14c03038f91513ea128893e8d0865b80359ca07b96f819269baebe06732bb4ad85604051610b879190611464565b60405180910390a2600192505050919050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610bf257600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610c9357506000700100000000000000000000000000000000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205416145b610c9c57600080fd5b6081600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282549060020a0292505081905550700100000000000000000000000000000000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825417925050819055503373ffffffffffffffffffffffffffffffffffffffff167f5e0504df353b1d59607f86d088afd2819ce3e6013ba1bbdb1dd9072ea3b30d4583604051610d929190611464565b60405180910390a260019050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4a57600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560019050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610eef57600080fd5b6040600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054908060020a82049150509050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff16633ef25013836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401610fbf9190611464565b602060405180830381865afa158015610fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110009190611567565b801561105e575070010000000000000000000000000000000080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541614155b9050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c157600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60016020528060005260406000206000915090505481565b60008060018361114a91906115f2565b8154811061115b5761115a611594565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ea57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611310816112db565b811461131b57600080fd5b50565b60008135905061132d81611307565b92915050565b600060208284031215611349576113486112d6565b5b60006113578482850161131e565b91505092915050565b60008115159050919050565b61137581611360565b82525050565b6000602082019050611390600083018461136c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113c182611396565b9050919050565b6113d1816113b6565b81146113dc57600080fd5b50565b6000813590506113ee816113c8565b92915050565b60006020828403121561140a576114096112d6565b5b6000611418848285016113df565b91505092915050565b6000819050919050565b61143481611421565b82525050565b600060208201905061144f600083018461142b565b92915050565b61145e816113b6565b82525050565b60006020820190506114796000830184611455565b92915050565b61148881611421565b811461149357600080fd5b50565b6000813590506114a58161147f565b92915050565b6000602082840312156114c1576114c06112d6565b5b60006114cf84828501611496565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061151282611421565b915061151d83611421565b9250828203905081811115611535576115346114d8565b5b92915050565b61154481611360565b811461154f57600080fd5b50565b6000815190506115618161153b565b92915050565b60006020828403121561157d5761157c6112d6565b5b600061158b84828501611552565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006115fd82611421565b915061160883611421565b92508282019050808211156116205761161f6114d8565b5b9291505056fea2646970667358221220ec832e0f873f0cdd7a5ddb40f651729181d5ae8492f7ae639c1168876946f5f964736f6c63430008120033 -\ No newline at end of file +608060405234801561001057600080fd5b5033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611753806100c36000396000f3fe608060405234801561001057600080fd5b506004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900480635ae06f7e116100b4578063da2824a811610083578063da2824a81461033e578063e0db665b1461036e578063e2095c071461039e578063f2fde38b146103ce5761011d565b80635ae06f7e146102905780637c67a3e2146102c05780638da5cb5b146102f05780639f8a13d71461030e5761011d565b806329092d0e116100f057806329092d0e146101d05780632b29ba23146102005780633ea053eb146102305780633ef25013146102605761011d565b806301ffc9a7146101225780630a3b0a4f146101525780630cbb0f83146101825780631c5a9d9c146101a0575b600080fd5b61013c6004803603810190610137919061142a565b6103fe565b6040516101499190611472565b60405180910390f35b61016c600480360381019061016791906114eb565b610552565b6040516101799190611472565b60405180910390f35b61018a610734565b6040516101979190611531565b60405180910390f35b6101ba60048036038101906101b591906114eb565b61074d565b6040516101c79190611472565b60405180910390f35b6101ea60048036038101906101e591906114eb565b6108fc565b6040516101f79190611472565b60405180910390f35b61021a600480360381019061021591906114eb565b610bd5565b6040516102279190611472565b60405180910390f35b61024a600480360381019061024591906114eb565b610bf5565b6040516102579190611472565b60405180910390f35b61027a600480360381019061027591906114eb565b610dfe565b6040516102879190611472565b60405180910390f35b6102aa60048036038101906102a591906114eb565b610e49565b6040516102b79190611472565b60405180910390f35b6102da60048036038101906102d591906114eb565b610f4b565b6040516102e79190611531565b60405180910390f35b6102f8610feb565b604051610305919061155b565b60405180910390f35b610328600480360381019061032391906114eb565b611011565b6040516103359190611472565b60405180910390f35b610358600480360381019061035391906114eb565b61110e565b6040516103659190611472565b60405180910390f35b610388600480360381019061038391906114eb565b611219565b6040516103959190611531565b60405180910390f35b6103b860048036038101906103b391906115a2565b611231565b6040516103c5919061155b565b60405180910390f35b6103e860048036038101906103e391906114eb565b611284565b6040516103f59190611472565b60405180910390f35b600063cbdb05c77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610452576001905061054d565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104a4576001905061054d565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104f6576001905061054d565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610548576001905061054d565b600090505b919050565b6000806000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166105ad57600080fd5b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146105f957600080fd5b680100000000000000006000805490501061061357600080fd5b60008054905091506000849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508167ffffffffffffffff1690506040429060020a028117905080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f0e0a4bee74426fd0767a5c0887f18db17207090abad67f13ae982a18a000e3d785604051610721919061155b565b60405180910390a2600192505050919050565b6000600160008054905061074891906115fe565b905090565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166107a557600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610845575070010000000000000000000000000000000080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205416145b61084e57600080fd5b6081600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254908060020a8204915050925050819055503373ffffffffffffffffffffffffffffffffffffffff167fa27913ebf7f29594798a64cfe7cabb550ef9670075e217c2f4c1e532a899baea836040516108eb919061155b565b60405180910390a260019050919050565b6000806000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661095757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16633ef25013856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016109ac919061155b565b602060405180830381865afa1580156109c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ed919061165e565b6109f657600080fd5b6001600080549050610a0891906115fe565b9050600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915080821015610af05760008181548110610a6857610a6761168b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008381548110610aa757610aa661168b565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6000805480610b0257610b016116ba565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f14c03038f91513ea128893e8d0865b80359ca07b96f819269baebe06732bb4ad85604051610bc2919061155b565b60405180910390a2600192505050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610c4d57600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610cee57506000700100000000000000000000000000000000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205416145b610cf757600080fd5b6081600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282549060020a0292505081905550700100000000000000000000000000000000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825417925050819055503373ffffffffffffffffffffffffffffffffffffffff167f5e0504df353b1d59607f86d088afd2819ce3e6013ba1bbdb1dd9072ea3b30d4583604051610ded919061155b565b60405180910390a260019050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea557600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690553373ffffffffffffffffffffffffffffffffffffffff167f39df39ed6dfb3955f48437f21bb5bc8fb02b45e95fab40ed708360c255af33e483604051610f3a919061155b565b60405180910390a260019050919050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610f9857600080fd5b6040600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054908060020a82049150509050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff16633ef25013836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401611068919061155b565b602060405180830381865afa158015611085573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a9919061165e565b8015611107575070010000000000000000000000000000000080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541614155b9050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116a57600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fd70794aee7ce40a1d5b28381c62e215884808f1b1af74ca65ec351ceb3cc8f3983604051611208919061155b565b60405180910390a260019050919050565b60016020528060005260406000206000915090505481565b60008060018361124191906116e9565b815481106112525761125161168b565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112e157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611407816113d2565b811461141257600080fd5b50565b600081359050611424816113fe565b92915050565b6000602082840312156114405761143f6113cd565b5b600061144e84828501611415565b91505092915050565b60008115159050919050565b61146c81611457565b82525050565b60006020820190506114876000830184611463565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114b88261148d565b9050919050565b6114c8816114ad565b81146114d357600080fd5b50565b6000813590506114e5816114bf565b92915050565b600060208284031215611501576115006113cd565b5b600061150f848285016114d6565b91505092915050565b6000819050919050565b61152b81611518565b82525050565b60006020820190506115466000830184611522565b92915050565b611555816114ad565b82525050565b6000602082019050611570600083018461154c565b92915050565b61157f81611518565b811461158a57600080fd5b50565b60008135905061159c81611576565b92915050565b6000602082840312156115b8576115b76113cd565b5b60006115c68482850161158d565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061160982611518565b915061161483611518565b925082820390508181111561162c5761162b6115cf565b5b92915050565b61163b81611457565b811461164657600080fd5b50565b60008151905061165881611632565b92915050565b600060208284031215611674576116736113cd565b5b600061168284828501611649565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006116f482611518565b91506116ff83611518565b9250828201905080821115611717576117166115cf565b5b9291505056fea2646970667358221220381907a7134d7c5c9477916e35e4327e7fa120f55aad391aa4a2932f0fdf5d6864736f6c63430008120033 +\ No newline at end of file diff --git a/python/eth_accounts_index/data/AccountsIndex.json b/python/eth_accounts_index/data/AccountsIndex.json @@ -1 +1 @@ -[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressInactive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"activate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"addWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"deactivate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"deleteWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_i","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"entryIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"have","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"remove","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] +[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressInactive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"WriterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_executor","type":"address"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"WriterDeleted","type":"event"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"activate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"addWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"deactivate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"deleteWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_i","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"entryIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"have","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"remove","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/solidity/AccountsIndex.sol b/solidity/AccountsIndex.sol @@ -8,7 +8,7 @@ contract CustodialAccountIndex { uint256 constant blockedField = 1 << 128; address[] entryList; mapping(address => uint256) public entryIndex; - mapping(address => bool) writers; + mapping(address => bool) public isWriter; address public owner; address newOwner; @@ -17,6 +17,8 @@ contract CustodialAccountIndex { event AddressInactive(address indexed _executor, address _account); event AddressRemoved(address indexed _executor, address _account); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // EIP173 + event WriterAdded(address indexed _executor, address _account); // AccountsIndex + event WriterDeleted(address indexed _executor, address _account); constructor() { owner = msg.sender; @@ -29,13 +31,15 @@ contract CustodialAccountIndex { function addWriter(address _writer) public returns (bool) { require(owner == msg.sender); - writers[_writer] = true; + isWriter[_writer] = true; + emit WriterAdded(msg.sender, _writer); return true; } function deleteWriter(address _writer) public returns (bool) { require(owner == msg.sender); - delete writers[_writer]; + delete isWriter[_writer]; + emit WriterDeleted(msg.sender, _writer); return true; } @@ -44,7 +48,7 @@ contract CustodialAccountIndex { uint256 i; uint256 _entry; - require(writers[msg.sender]); + require(isWriter[msg.sender]); require(entryIndex[_account] == 0); require(entryList.length < (1 << 64)); i = entryList.length; @@ -61,7 +65,7 @@ contract CustodialAccountIndex { uint256 i; uint256 l; - require(writers[msg.sender]); + require(isWriter[msg.sender]); require(this.have(_account)); l = entryList.length - 1; @@ -79,7 +83,7 @@ contract CustodialAccountIndex { // Implements AccountsIndex // Activate previously deactivated account. Will not affect the entry count. function activate(address _account) external returns (bool) { - require(writers[msg.sender]); + require(isWriter[msg.sender]); require(entryIndex[_account] > 0 && entryIndex[_account] & blockedField == blockedField); entryIndex[_account] >>= 129; emit AddressActive(msg.sender, _account); @@ -89,7 +93,7 @@ contract CustodialAccountIndex { // Implements AccountsIndex // Deactivate account, without removing the entry. The entry will still be part of the entry count. function deactivate(address _account) external returns (bool) { - require(writers[msg.sender]); + require(isWriter[msg.sender]); require(entryIndex[_account] > 0 && entryIndex[_account] & blockedField == 0); entryIndex[_account] <<= 129; entryIndex[_account] |= blockedField;