commit 83981d60188f46c2053b4e5a171932b4e6c2bf89
parent 6674b86ea2d60a92e008b7f00ccdbbe3a017d59a
Author: lash <dev@holbrook.no>
Date: Mon, 19 Jun 2023 12:10:29 +0100
Prevent duplicate removal of entries
Diffstat:
7 files changed, 57 insertions(+), 6 deletions(-)
diff --git a/python/CHANGELOG b/python/CHANGELOG
@@ -1,3 +1,5 @@
+- 0.6.2
+ * Prevent double removal on index entry
- 0.6.1
* Update list tool to chainlib 0.4.x arg flags
* Skip listing of superseded tokens (reverse lookup does not match entry index)
diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.bin b/python/eth_token_index/data/TokenUniqueSymbolIndex.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b5033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005600060010290806001815401808255809150506001900390600052602060002001600090919091909150556119f4806100f26000396000f3fe608060405234801561001057600080fd5b506004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900480634420e486116100b4578063d56b7d4e11610083578063d56b7d4e1461032c578063da2824a81461035c578063e2095c071461038c578063f2fde38b146103bc5761011d565b80634420e4861461027e5780635ae06f7e146102ae5780638da5cb5b146102de578063bb34534c146102fc5761011d565b80631c5a9d9c116100f05780631c5a9d9c146101d057806329092d0e146102005780633480c704146102305780633ea053eb1461024e5761011d565b806301ffc9a7146101225780630a3b0a4f146101525780630cbb0f8314610182578063110c57b3146101a0575b600080fd5b61013c6004803603810190610137919061129e565b6103ec565b60405161014991906112e6565b60405180910390f35b61016c6004803603810190610167919061135f565b6105e4565b60405161017991906112e6565b60405180910390f35b61018a6105f6565b60405161019791906113a5565b60405180910390f35b6101ba60048036038101906101b591906113ec565b61060f565b6040516101c79190611432565b60405180910390f35b6101ea60048036038101906101e5919061135f565b610633565b6040516101f791906112e6565b60405180910390f35b61021a6004803603810190610215919061135f565b61063a565b60405161022791906112e6565b60405180910390f35b610238610a93565b60405161024591906113a5565b60405180910390f35b6102686004803603810190610263919061135f565b610aac565b60405161027591906112e6565b60405180910390f35b6102986004803603810190610293919061135f565b610ab3565b6040516102a591906112e6565b60405180910390f35b6102c860048036038101906102c3919061135f565b610dfe565b6040516102d591906112e6565b60405180910390f35b6102e6610ee8565b6040516102f3919061145c565b60405180910390f35b610316600480360381019061031191906114a3565b610f0e565b604051610323919061145c565b60405180910390f35b610346600480360381019061034191906113ec565b610f6e565b6040516103539190611432565b60405180910390f35b6103766004803603810190610371919061135f565b610fa2565b60405161038391906112e6565b60405180910390f35b6103a660048036038101906103a191906113ec565b611095565b6040516103b3919061145c565b60405180910390f35b6103d660048036038101906103d1919061135f565b6110e9565b6040516103e391906112e6565b60405180910390f35b600063effbf6717c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361044057600190506105df565b63b7bca6257c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361049257600190506105df565b639479f0ae7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104e457600190506105df565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361053657600190506105df565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361058857600190506105df565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105da57600190506105df565b600090505b919050565b60006105ef82610ab3565b9050919050565b6000600160038054905061060a91906114ff565b905090565b6005818154811061061f57600080fd5b906000526020600020016000915090505481565b6000919050565b60008060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806106e35750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610722576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071990611590565b60405180910390fd5b6000600102600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036107a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079e906115fc565b60405180910390fd5b60016003805490506107b991906114ff565b905060016000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020549150808210156108f5576003818154811061082c5761082b61161c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003838154811061086b5761086a61161c565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600581815481106108c7576108c661161c565b5b9060005260206000200154600583815481106108e6576108e561161c565b5b90600052602060002001819055505b816001600060026000600387815481106109125761091161161c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002081905550600380548061099c5761099b61164b565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905560058054806109e3576109e261164b565b5b60019003818190600052602060002001600090559055600060016000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055507f24a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb84604051610a80919061145c565b60405180910390a1600192505050919050565b60006001600580549050610aa791906114ff565b905090565b6000919050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b0a57600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610bb991906116eb565b6000604051808303816000865af19150503d8060008114610bf6576040519150601f19603f3d011682016040523d82523d6000602084013e610bfb565b606091505b509150915081610c0a57600080fd5b80806020019051810190610c1e9190611839565b9450602085511115610c65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5c906118ce565b60405180910390fd5b84610c6f90611923565b93506001600085815260200190815260200160002054925060008314610c9457600080fd5b60038054905060016000868152602001908152602001600020819055506003879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600584908060018154018082558091505060019003906000526020600020016000909190919091505583600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb88604051610db1919061145c565b60405180910390a27fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f87604051610de8919061145c565b60405180910390a1600195505050505050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5a57600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690557f9002f14780245e47491e7a2caae4712e7cea2e298e4e76c6916845145b90a51c82604051610ed7919061145c565b60405180910390a160019050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600084815260200190815260200160002054905060038181548110610f3b57610f3a61161c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60006005600183610f7f919061198a565b81548110610f9057610f8f61161c565b5b90600052602060002001549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ffe57600080fd5b60016000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f6ff3aa2ea7b53070f6d9d07a445d338d89e8edef44250ffa8be19f53910d4a2e82604051611084919061145c565b60405180910390a160019050919050565b600060036001836110a6919061198a565b815481106110b7576110b661161c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461114657600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61127b81611246565b811461128657600080fd5b50565b60008135905061129881611272565b92915050565b6000602082840312156112b4576112b361123c565b5b60006112c284828501611289565b91505092915050565b60008115159050919050565b6112e0816112cb565b82525050565b60006020820190506112fb60008301846112d7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061132c82611301565b9050919050565b61133c81611321565b811461134757600080fd5b50565b60008135905061135981611333565b92915050565b6000602082840312156113755761137461123c565b5b60006113838482850161134a565b91505092915050565b6000819050919050565b61139f8161138c565b82525050565b60006020820190506113ba6000830184611396565b92915050565b6113c98161138c565b81146113d457600080fd5b50565b6000813590506113e6816113c0565b92915050565b6000602082840312156114025761140161123c565b5b6000611410848285016113d7565b91505092915050565b6000819050919050565b61142c81611419565b82525050565b60006020820190506114476000830184611423565b92915050565b61145681611321565b82525050565b6000602082019050611471600083018461144d565b92915050565b61148081611419565b811461148b57600080fd5b50565b60008135905061149d81611477565b92915050565b6000602082840312156114b9576114b861123c565b5b60006114c78482850161148e565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061150a8261138c565b91506115158361138c565b925082820390508181111561152d5761152c6114d0565b5b92915050565b600082825260208201905092915050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b600061157a600783611533565b915061158582611544565b602082019050919050565b600060208201905081810360008301526115a98161156d565b9050919050565b7f4552525f4e4f545f464f554e4400000000000000000000000000000000000000600082015250565b60006115e6600d83611533565b91506115f1826115b0565b602082019050919050565b60006020820190508181036000830152611615816115d9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b838110156116ae578082015181840152602081019050611693565b60008484015250505050565b60006116c58261167a565b6116cf8185611685565b93506116df818560208601611690565b80840191505092915050565b60006116f782846116ba565b915081905092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6117558261170c565b810181811067ffffffffffffffff821117156117745761177361171d565b5b80604052505050565b6000611787611232565b9050611793828261174c565b919050565b600067ffffffffffffffff8211156117b3576117b261171d565b5b6117bc8261170c565b9050602081019050919050565b60006117dc6117d784611798565b61177d565b9050828152602081018484840111156117f8576117f7611707565b5b611803848285611690565b509392505050565b600082601f8301126118205761181f611702565b5b81516118308482602086016117c9565b91505092915050565b60006020828403121561184f5761184e61123c565b5b600082015167ffffffffffffffff81111561186d5761186c611241565b5b6118798482850161180b565b91505092915050565b7f4552525f544f4b454e5f53594d424f4c5f544f4f5f4c4f4e4700000000000000600082015250565b60006118b8601983611533565b91506118c382611882565b602082019050919050565b600060208201905081810360008301526118e7816118ab565b9050919050565b6000819050602082019050919050565b600061190a8251611419565b80915050919050565b60008160020a8302905092915050565b600061192e8261167a565b82611938846118ee565b9050611943816118fe565b925060208210156119835761197e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802611913565b831692505b5050919050565b60006119958261138c565b91506119a08361138c565b92508282019050808211156119b8576119b76114d0565b5b9291505056fea2646970667358221220d02eaf4aafec599cc9dbd2e68d89e98e71a3ca83ecf62049f1d35453a670622a64736f6c63430008120033
-\ No newline at end of file
+608060405234801561001057600080fd5b5033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560006001029080600181540180825580915050600190039060005260206000200160009091909190915055611a3c806100f26000396000f3fe608060405234801561001057600080fd5b506004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900480634420e486116100b4578063d56b7d4e11610083578063d56b7d4e1461032c578063da2824a81461035c578063e2095c071461038c578063f2fde38b146103bc5761011d565b80634420e4861461027e5780635ae06f7e146102ae5780638da5cb5b146102de578063bb34534c146102fc5761011d565b80631c5a9d9c116100f05780631c5a9d9c146101d057806329092d0e146102005780633480c704146102305780633ea053eb1461024e5761011d565b806301ffc9a7146101225780630a3b0a4f146101525780630cbb0f8314610182578063110c57b3146101a0575b600080fd5b61013c600480360381019061013791906112e6565b6103ec565b604051610149919061132e565b60405180910390f35b61016c600480360381019061016791906113a7565b6105e4565b604051610179919061132e565b60405180910390f35b61018a6105f6565b60405161019791906113ed565b60405180910390f35b6101ba60048036038101906101b59190611434565b61060f565b6040516101c7919061147a565b60405180910390f35b6101ea60048036038101906101e591906113a7565b610633565b6040516101f7919061132e565b60405180910390f35b61021a600480360381019061021591906113a7565b61063a565b604051610227919061132e565b60405180910390f35b610238610adb565b60405161024591906113ed565b60405180910390f35b610268600480360381019061026391906113a7565b610af4565b604051610275919061132e565b60405180910390f35b610298600480360381019061029391906113a7565b610afb565b6040516102a5919061132e565b60405180910390f35b6102c860048036038101906102c391906113a7565b610e46565b6040516102d5919061132e565b60405180910390f35b6102e6610f30565b6040516102f391906114a4565b60405180910390f35b610316600480360381019061031191906114eb565b610f56565b60405161032391906114a4565b60405180910390f35b61034660048036038101906103419190611434565b610fb6565b604051610353919061147a565b60405180910390f35b610376600480360381019061037191906113a7565b610fea565b604051610383919061132e565b60405180910390f35b6103a660048036038101906103a19190611434565b6110dd565b6040516103b391906114a4565b60405180910390f35b6103d660048036038101906103d191906113a7565b611131565b6040516103e3919061132e565b60405180910390f35b600063effbf6717c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361044057600190506105df565b63b7bca6257c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361049257600190506105df565b639479f0ae7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104e457600190506105df565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361053657600190506105df565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361058857600190506105df565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036105da57600190506105df565b600090505b919050565b60006105ef82610afb565b9050919050565b6000600160038054905061060a9190611547565b905090565b6005818154811061061f57600080fd5b906000526020600020016000915090505481565b6000919050565b60008060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806106e35750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610722576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610719906115d8565b60405180910390fd5b6000600102600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036107a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079e90611644565b60405180910390fd5b60016003805490506107b99190611547565b905060016000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020549150808210156108f5576003818154811061082c5761082b611664565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003838154811061086b5761086a611664565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600581815481106108c7576108c6611664565b5b9060005260206000200154600583815481106108e6576108e5611664565b5b90600052602060002001819055505b8160016000600260006003878154811061091257610911611664565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002081905550600380548061099c5761099b611693565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905560058054806109e3576109e2611693565b5b60019003818190600052602060002001600090559055600060016000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506000600102600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f24a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb84604051610ac891906114a4565b60405180910390a1600192505050919050565b60006001600580549050610aef9190611547565b905090565b6000919050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b5257600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c019190611733565b6000604051808303816000865af19150503d8060008114610c3e576040519150601f19603f3d011682016040523d82523d6000602084013e610c43565b606091505b509150915081610c5257600080fd5b80806020019051810190610c669190611881565b9450602085511115610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca490611916565b60405180910390fd5b84610cb79061196b565b93506001600085815260200190815260200160002054925060008314610cdc57600080fd5b60038054905060016000868152602001908152602001600020819055506003879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600584908060018154018082558091505060019003906000526020600020016000909190919091505583600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb88604051610df991906114a4565b60405180910390a27fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f87604051610e3091906114a4565b60405180910390a1600195505050505050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea257600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690557f9002f14780245e47491e7a2caae4712e7cea2e298e4e76c6916845145b90a51c82604051610f1f91906114a4565b60405180910390a160019050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600084815260200190815260200160002054905060038181548110610f8357610f82611664565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60006005600183610fc791906119d2565b81548110610fd857610fd7611664565b5b90600052602060002001549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461104657600080fd5b60016000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f6ff3aa2ea7b53070f6d9d07a445d338d89e8edef44250ffa8be19f53910d4a2e826040516110cc91906114a4565b60405180910390a160019050919050565b600060036001836110ee91906119d2565b815481106110ff576110fe611664565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461118e57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6112c38161128e565b81146112ce57600080fd5b50565b6000813590506112e0816112ba565b92915050565b6000602082840312156112fc576112fb611284565b5b600061130a848285016112d1565b91505092915050565b60008115159050919050565b61132881611313565b82525050565b6000602082019050611343600083018461131f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061137482611349565b9050919050565b61138481611369565b811461138f57600080fd5b50565b6000813590506113a18161137b565b92915050565b6000602082840312156113bd576113bc611284565b5b60006113cb84828501611392565b91505092915050565b6000819050919050565b6113e7816113d4565b82525050565b600060208201905061140260008301846113de565b92915050565b611411816113d4565b811461141c57600080fd5b50565b60008135905061142e81611408565b92915050565b60006020828403121561144a57611449611284565b5b60006114588482850161141f565b91505092915050565b6000819050919050565b61147481611461565b82525050565b600060208201905061148f600083018461146b565b92915050565b61149e81611369565b82525050565b60006020820190506114b96000830184611495565b92915050565b6114c881611461565b81146114d357600080fd5b50565b6000813590506114e5816114bf565b92915050565b60006020828403121561150157611500611284565b5b600061150f848285016114d6565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611552826113d4565b915061155d836113d4565b925082820390508181111561157557611574611518565b5b92915050565b600082825260208201905092915050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b60006115c260078361157b565b91506115cd8261158c565b602082019050919050565b600060208201905081810360008301526115f1816115b5565b9050919050565b7f4552525f4e4f545f464f554e4400000000000000000000000000000000000000600082015250565b600061162e600d8361157b565b9150611639826115f8565b602082019050919050565b6000602082019050818103600083015261165d81611621565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b838110156116f65780820151818401526020810190506116db565b60008484015250505050565b600061170d826116c2565b61171781856116cd565b93506117278185602086016116d8565b80840191505092915050565b600061173f8284611702565b915081905092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61179d82611754565b810181811067ffffffffffffffff821117156117bc576117bb611765565b5b80604052505050565b60006117cf61127a565b90506117db8282611794565b919050565b600067ffffffffffffffff8211156117fb576117fa611765565b5b61180482611754565b9050602081019050919050565b600061182461181f846117e0565b6117c5565b9050828152602081018484840111156118405761183f61174f565b5b61184b8482856116d8565b509392505050565b600082601f8301126118685761186761174a565b5b8151611878848260208601611811565b91505092915050565b60006020828403121561189757611896611284565b5b600082015167ffffffffffffffff8111156118b5576118b4611289565b5b6118c184828501611853565b91505092915050565b7f4552525f544f4b454e5f53594d424f4c5f544f4f5f4c4f4e4700000000000000600082015250565b600061190060198361157b565b915061190b826118ca565b602082019050919050565b6000602082019050818103600083015261192f816118f3565b9050919050565b6000819050602082019050919050565b60006119528251611461565b80915050919050565b60008160020a8302905092915050565b6000611976826116c2565b8261198084611936565b905061198b81611946565b925060208210156119cb576119c67fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8360200360080261195b565b831692505b5050919050565b60006119dd826113d4565b91506119e8836113d4565b9250828201905080821115611a00576119ff611518565b5b9291505056fea26469706673582212206244a39c37bddabf71e9b074276edb94ba7c2c5c4838ab672a26f981e8e80cda64736f6c63430008130033
+\ No newline at end of file
diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.metadata.json b/python/eth_token_index/data/TokenUniqueSymbolIndex.metadata.json
@@ -1 +1 @@
-{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_symbol","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_token","type":"address"}],"name":"AddressKey","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","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":false,"internalType":"address","name":"_writer","type":"address"}],"name":"WriterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_writer","type":"address"}],"name":"WriterDeleted","type":"event"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"activate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_token","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":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"deactivate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","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":"_idx","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":"uint256","name":"_idx","type":"uint256"}],"name":"identifier","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifierList","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","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":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"TokenUniqueSymbolIndex.sol":"TokenUniqueSymbolIndex"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"TokenUniqueSymbolIndex.sol":{"keccak256":"0x472d243e57b740cc7d8cec688bbd7fa76f979f6d857965cda1728d710595cc5e","license":"AGPL-3.0-or-later","urls":["bzz-raw://76a5eacbf65373e2275f1a9a1ec7120d98db592b395ad0503d62e0d18bf23905","dweb:/ipfs/QmNs8Bk5SuFUVG571QyoWQYk2B9ouGhqGU4vMNkQW9dM9j"]}},"version":1}
+{"compiler":{"version":"0.8.19+commit.7dd6d404"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_symbol","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_token","type":"address"}],"name":"AddressKey","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","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":false,"internalType":"address","name":"_writer","type":"address"}],"name":"WriterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_writer","type":"address"}],"name":"WriterDeleted","type":"event"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"activate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_token","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":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"deactivate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","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":"_idx","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":"uint256","name":"_idx","type":"uint256"}],"name":"identifier","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifierList","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","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":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"TokenUniqueSymbolIndex.sol":"TokenUniqueSymbolIndex"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"TokenUniqueSymbolIndex.sol":{"keccak256":"0x97fe152b0ea0a1a30eb46975addab05bfb3712a3e8e36e904f039738565cb2c6","license":"AGPL-3.0-or-later","urls":["bzz-raw://5c2257c5d9197fd4bf5abfdee59231a3c9232d64df4d61a4fbb4edcc3ba1f3ce","dweb:/ipfs/Qmd8E15hrD7h89o3Zy11abuJDDKeN9rk6iQ1yxcFiTK1Mb"]}},"version":1}
diff --git a/python/eth_token_index/index.py b/python/eth_token_index/index.py
@@ -85,6 +85,18 @@ class TokenUniqueSymbolIndex(TxFactory):
return tx
+ def remove(self, contract_address, sender_address, address, tx_format=TxFormat.JSONRPC):
+ enc = ABIContractEncoder()
+ enc.method('remove')
+ enc.typ(ABIContractType.ADDRESS)
+ enc.address(address)
+ data = enc.get()
+ tx = self.template(sender_address, contract_address, use_nonce=True)
+ tx = self.set_code(tx, data)
+ tx = self.finalize(tx, tx_format)
+ return tx
+
+
def add_writer(self, contract_address, sender_address, address, tx_format=TxFormat.JSONRPC, id_generator=None):
enc = ABIContractEncoder()
enc.method('addWriter')
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = eth-token-index
-version = 0.6.1
+version = 0.6.2
description = Token symbol to address unique index
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/python/tests/test_tokenindex.py b/python/tests/test_tokenindex.py
@@ -7,6 +7,8 @@ import hashlib
# external imports
from chainlib.eth.unittest.ethtester import EthTesterCase
+from chainlib.eth.constant import ZERO_ADDRESS
+from chainlib.eth.address import is_same_address
from chainlib.eth.nonce import RPCNonceOracle
from chainlib.eth.tx import receipt
from chainlib.error import JSONRPCException
@@ -70,7 +72,7 @@ class TestTokenUniqueSymbolIndex(EthTesterCase):
(tx_hash_hex, o) = c.register(self.address, self.accounts[0], self.foo_token_address)
self.rpc.do(o)
- e = unpack(bytes.fromhex(strip_0x(o['params'][0])), self.chain_spec)
+ #e = unpack(bytes.fromhex(strip_0x(o['params'][0])), self.chain_spec)
o = receipt(tx_hash_hex)
r = self.rpc.do(o)
@@ -92,6 +94,40 @@ class TestTokenUniqueSymbolIndex(EthTesterCase):
self.assertEqual(count, 1)
+ def test_remove(self):
+ nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
+ c = TokenUniqueSymbolIndex(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
+
+ (tx_hash_hex, o) = c.register(self.address, self.accounts[0], self.foo_token_address)
+ self.rpc.do(o)
+ #e = unpack(bytes.fromhex(strip_0x(o['params'][0])), self.chain_spec)
+
+ (tx_hash_hex, o) = c.remove(self.address, self.accounts[0], self.foo_token_address)
+ self.rpc.do(o)
+ o = receipt(tx_hash_hex)
+ r = self.rpc.do(o)
+ self.assertEqual(r['status'], 1)
+
+ o = c.address_of(self.address, 'FOO', sender_address=self.accounts[0])
+ r = self.rpc.do(o)
+ address = c.parse_address_of(r)
+ self.assertTrue(is_same_address(address, ZERO_ADDRESS))
+
+ o = c.entry(self.address, 0, sender_address=self.accounts[0])
+ with self.assertRaises(JSONRPCException):
+ self.rpc.do(o)
+
+ o = c.entry_count(self.address, sender_address=self.accounts[0])
+ r = self.rpc.do(o)
+ count = c.parse_entry_count(r)
+ self.assertEqual(count, 0)
+
+ (tx_hash_hex, o) = c.remove(self.address, self.accounts[0], self.foo_token_address)
+ self.rpc.do(o)
+ o = receipt(tx_hash_hex)
+ r = self.rpc.do(o)
+ self.assertEqual(r['status'], 0)
+
def test_identifiers(self):
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
diff --git a/solidity/TokenUniqueSymbolIndex.sol b/solidity/TokenUniqueSymbolIndex.sol
@@ -98,11 +98,12 @@ contract TokenUniqueSymbolIndex {
if (i < l) {
tokens[i] = tokens[l];
identifierList[i] = identifierList[l];
- }
+ }
registry[tokenIndex[tokens[i]]] = i;
tokens.pop();
identifierList.pop();
registry[tokenIndex[_token]] = 0;
+ tokenIndex[_token] = bytes32(0);
emit AddressRemoved(_token);
return true;