eth-token-index

Token symbol to address unique index
Log | Files | Refs

commit c94b344264262dddb9ee2edce247b3d53164f619
parent 8b07a9f3dc3e436b90e90ab5a73affe3a22e1e02
Author: lash <dev@holbrook.no>
Date:   Sat, 25 Mar 2023 16:23:16 +0000

Add registry implementation

Diffstat:
Mpython/eth_token_index/data/TokenUniqueSymbolIndex.bin | 4++--
Mpython/eth_token_index/data/TokenUniqueSymbolIndex.json | 2+-
Mpython/eth_token_index/data/TokenUniqueSymbolIndex.metadata.json | 2+-
Msolidity/TokenUniqueSymbolIndex.sol | 19++++++++++++++-----
4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.bin b/python/eth_token_index/data/TokenUniqueSymbolIndex.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611721806100c46000396000f3fe608060405234801561001057600080fd5b50600436106100ec576000357c0100000000000000000000000000000000000000000000000000000000900480634420e486116100a9578063bb34534c11610083578063bb34534c1461027d578063da2824a8146102ad578063e2095c07146102dd578063f2fde38b1461030d576100ec565b80634420e486146101ff5780635ae06f7e1461022f5780638da5cb5b1461025f576100ec565b806301ffc9a7146100f15780630a3b0a4f146101215780630cbb0f83146101515780631c5a9d9c1461016f57806329092d0e1461019f5780633ea053eb146101cf575b600080fd5b61010b60048036038101906101069190610ff5565b61033d565b604051610118919061103d565b60405180910390f35b61013b600480360381019061013691906110b6565b610535565b604051610148919061103d565b60405180910390f35b610159610547565b60405161016691906110fc565b60405180910390f35b610189600480360381019061018491906110b6565b610560565b604051610196919061103d565b60405180910390f35b6101b960048036038101906101b491906110b6565b610567565b6040516101c6919061103d565b60405180910390f35b6101e960048036038101906101e491906110b6565b61086b565b6040516101f6919061103d565b60405180910390f35b610219600480360381019061021491906110b6565b610872565b604051610226919061103d565b60405180910390f35b610249600480360381019061024491906110b6565b610b95565b604051610256919061103d565b60405180910390f35b610267610c7e565b6040516102749190611126565b60405180910390f35b61029760048036038101906102929190611177565b610ca2565b6040516102a49190611126565b60405180910390f35b6102c760048036038101906102c291906110b6565b610d02565b6040516102d4919061103d565b60405180910390f35b6102f760048036038101906102f291906111d0565b610df3565b6040516103049190611126565b60405180910390f35b610327600480360381019061032291906110b6565b610e47565b604051610334919061103d565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036103915760019050610530565b63b7bca6257c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036103e35760019050610530565b639479f0ae7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104355760019050610530565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104875760019050610530565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104d95760019050610530565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361052b5760019050610530565b600090505b919050565b600061054082610872565b9050919050565b6000600160048054905061055b919061122c565b905090565b6000919050565b6000806000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef906112bd565b60405180910390fd5b6000600102600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540361067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067490611329565b60405180910390fd5b600160048054905061068f919061122c565b905060026000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205491508082101561078a576004818154811061070257610701611349565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166004838154811061074157610740611349565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600480548061079c5761079b611378565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055600060026000600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055507f24a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb846040516108589190611126565b60405180910390a1600192505050919050565b6000919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166108ca57600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516109799190611418565b6000604051808303816000865af19150503d80600081146109b6576040519150601f19603f3d011682016040523d82523d6000602084013e6109bb565b606091505b5091509150816109ca57600080fd5b808060200190518101906109de9190611566565b9450602085511115610a25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1c906115fb565b60405180910390fd5b84610a2f90611650565b93506002600085815260200190815260200160002054925060008314610a5457600080fd5b60048054905060026000868152602001908152602001600020819055506004879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb88604051610b489190611126565b60405180910390a27fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f87604051610b7f9190611126565b60405180910390a1600195505050505050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bef57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690557f9002f14780245e47491e7a2caae4712e7cea2e298e4e76c6916845145b90a51c82604051610c6d9190611126565b60405180910390a160019050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806002600084815260200190815260200160002054905060048181548110610ccf57610cce611349565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5c57600080fd5b60018060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f6ff3aa2ea7b53070f6d9d07a445d338d89e8edef44250ffa8be19f53910d4a2e82604051610de29190611126565b60405180910390a160019050919050565b60006004600183610e0491906116b7565b81548110610e1557610e14611349565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ea257600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610fd281610f9d565b8114610fdd57600080fd5b50565b600081359050610fef81610fc9565b92915050565b60006020828403121561100b5761100a610f93565b5b600061101984828501610fe0565b91505092915050565b60008115159050919050565b61103781611022565b82525050565b6000602082019050611052600083018461102e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061108382611058565b9050919050565b61109381611078565b811461109e57600080fd5b50565b6000813590506110b08161108a565b92915050565b6000602082840312156110cc576110cb610f93565b5b60006110da848285016110a1565b91505092915050565b6000819050919050565b6110f6816110e3565b82525050565b600060208201905061111160008301846110ed565b92915050565b61112081611078565b82525050565b600060208201905061113b6000830184611117565b92915050565b6000819050919050565b61115481611141565b811461115f57600080fd5b50565b6000813590506111718161114b565b92915050565b60006020828403121561118d5761118c610f93565b5b600061119b84828501611162565b91505092915050565b6111ad816110e3565b81146111b857600080fd5b50565b6000813590506111ca816111a4565b92915050565b6000602082840312156111e6576111e5610f93565b5b60006111f4848285016111bb565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611237826110e3565b9150611242836110e3565b925082820390508181111561125a576112596111fd565b5b92915050565b600082825260208201905092915050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b60006112a7600783611260565b91506112b282611271565b602082019050919050565b600060208201905081810360008301526112d68161129a565b9050919050565b7f4552525f4e4f545f464f554e4400000000000000000000000000000000000000600082015250565b6000611313600d83611260565b915061131e826112dd565b602082019050919050565b6000602082019050818103600083015261134281611306565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b838110156113db5780820151818401526020810190506113c0565b60008484015250505050565b60006113f2826113a7565b6113fc81856113b2565b935061140c8185602086016113bd565b80840191505092915050565b600061142482846113e7565b915081905092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61148282611439565b810181811067ffffffffffffffff821117156114a1576114a061144a565b5b80604052505050565b60006114b4610f89565b90506114c08282611479565b919050565b600067ffffffffffffffff8211156114e0576114df61144a565b5b6114e982611439565b9050602081019050919050565b6000611509611504846114c5565b6114aa565b90508281526020810184848401111561152557611524611434565b5b6115308482856113bd565b509392505050565b600082601f83011261154d5761154c61142f565b5b815161155d8482602086016114f6565b91505092915050565b60006020828403121561157c5761157b610f93565b5b600082015167ffffffffffffffff81111561159a57611599610f98565b5b6115a684828501611538565b91505092915050565b7f4552525f544f4b454e5f53594d424f4c5f544f4f5f4c4f4e4700000000000000600082015250565b60006115e5601983611260565b91506115f0826115af565b602082019050919050565b60006020820190508181036000830152611614816115d8565b9050919050565b6000819050602082019050919050565b60006116378251611141565b80915050919050565b60008160020a8302905092915050565b600061165b826113a7565b826116658461161b565b90506116708161162b565b925060208210156116b0576116ab7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802611640565b831692505b5050919050565b60006116c2826110e3565b91506116cd836110e3565b92508282019050808211156116e5576116e46111fd565b5b9291505056fea26469706673582212202d5e34e38d3848059ea59164361dfb3c8b17c65d37e48efb3db4959be9855b3764736f6c63430008120033 -\ No newline at end of file +608060405234801561001057600080fd5b5033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611864806100c56000396000f3fe608060405234801561001057600080fd5b5060043610610112576000357c0100000000000000000000000000000000000000000000000000000000900480633ea053eb116100b4578063bb34534c11610083578063bb34534c146102f1578063da2824a814610321578063e2095c0714610351578063f2fde38b1461038157610112565b80633ea053eb146102435780634420e486146102735780635ae06f7e146102a35780638da5cb5b146102d357610112565b80631c5a9d9c116100f05780631c5a9d9c1461019557806328f2d4da146101c557806329092d0e146101f55780633480c7041461022557610112565b806301ffc9a7146101175780630a3b0a4f146101475780630cbb0f8314610177575b600080fd5b610131600480360381019061012c919061110e565b6103b1565b60405161013e9190611156565b60405180910390f35b610161600480360381019061015c91906111cf565b6105a9565b60405161016e9190611156565b60405180910390f35b61017f6105bb565b60405161018c9190611215565b60405180910390f35b6101af60048036038101906101aa91906111cf565b6105d4565b6040516101bc9190611156565b60405180910390f35b6101df60048036038101906101da919061125c565b6105db565b6040516101ec91906112a2565b60405180910390f35b61020f600480360381019061020a91906111cf565b6105ff565b60405161021c9190611156565b60405180910390f35b61022d610943565b60405161023a9190611215565b60405180910390f35b61025d600480360381019061025891906111cf565b610950565b60405161026a9190611156565b60405180910390f35b61028d600480360381019061028891906111cf565b610957565b60405161029a9190611156565b60405180910390f35b6102bd60048036038101906102b891906111cf565b610ca2565b6040516102ca9190611156565b60405180910390f35b6102db610d8c565b6040516102e891906112cc565b60405180910390f35b61030b60048036038101906103069190611313565b610db2565b60405161031891906112cc565b60405180910390f35b61033b600480360381019061033691906111cf565b610e12565b6040516103489190611156565b60405180910390f35b61036b6004803603810190610366919061125c565b610f05565b60405161037891906112cc565b60405180910390f35b61039b600480360381019061039691906111cf565b610f59565b6040516103a89190611156565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361040557600190506105a4565b63b7bca6257c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361045757600190506105a4565b639479f0ae7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104a957600190506105a4565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104fb57600190506105a4565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361054d57600190506105a4565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361059f57600190506105a4565b600090505b919050565b60006105b482610957565b9050919050565b600060016003805490506105cf919061136f565b905090565b6000919050565b600581815481106105eb57600080fd5b906000526020600020016000915090505481565b60008060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661068f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068690611400565b60405180910390fd5b6000600102600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610714576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070b9061146c565b60405180910390fd5b6001600380549050610726919061136f565b905060016000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205491508082101561086257600381815481106107995761079861148c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481106107d8576107d761148c565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600581815481106108345761083361148c565b5b9060005260206000200154600583815481106108535761085261148c565b5b90600052602060002001819055505b6003805480610874576108736114bb565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055600060016000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055507f24a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb8460405161093091906112cc565b60405180910390a1600192505050919050565b6000600580549050905090565b6000919050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166109ae57600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610a5d919061155b565b6000604051808303816000865af19150503d8060008114610a9a576040519150601f19603f3d011682016040523d82523d6000602084013e610a9f565b606091505b509150915081610aae57600080fd5b80806020019051810190610ac291906116a9565b9450602085511115610b09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b009061173e565b60405180910390fd5b84610b1390611793565b93506001600085815260200190815260200160002054925060008314610b3857600080fd5b60038054905060016000868152602001908152602001600020819055506003879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600584908060018154018082558091505060019003906000526020600020016000909190919091505583600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb88604051610c5591906112cc565b60405180910390a27fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f87604051610c8c91906112cc565b60405180910390a1600195505050505050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfe57600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690557f9002f14780245e47491e7a2caae4712e7cea2e298e4e76c6916845145b90a51c82604051610d7b91906112cc565b60405180910390a160019050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806001600084815260200190815260200160002054905060038181548110610ddf57610dde61148c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6e57600080fd5b60016000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f6ff3aa2ea7b53070f6d9d07a445d338d89e8edef44250ffa8be19f53910d4a2e82604051610ef491906112cc565b60405180910390a160019050919050565b60006003600183610f1691906117fa565b81548110610f2757610f2661148c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb657600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6110eb816110b6565b81146110f657600080fd5b50565b600081359050611108816110e2565b92915050565b600060208284031215611124576111236110ac565b5b6000611132848285016110f9565b91505092915050565b60008115159050919050565b6111508161113b565b82525050565b600060208201905061116b6000830184611147565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061119c82611171565b9050919050565b6111ac81611191565b81146111b757600080fd5b50565b6000813590506111c9816111a3565b92915050565b6000602082840312156111e5576111e46110ac565b5b60006111f3848285016111ba565b91505092915050565b6000819050919050565b61120f816111fc565b82525050565b600060208201905061122a6000830184611206565b92915050565b611239816111fc565b811461124457600080fd5b50565b60008135905061125681611230565b92915050565b600060208284031215611272576112716110ac565b5b600061128084828501611247565b91505092915050565b6000819050919050565b61129c81611289565b82525050565b60006020820190506112b76000830184611293565b92915050565b6112c681611191565b82525050565b60006020820190506112e160008301846112bd565b92915050565b6112f081611289565b81146112fb57600080fd5b50565b60008135905061130d816112e7565b92915050565b600060208284031215611329576113286110ac565b5b6000611337848285016112fe565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061137a826111fc565b9150611385836111fc565b925082820390508181111561139d5761139c611340565b5b92915050565b600082825260208201905092915050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b60006113ea6007836113a3565b91506113f5826113b4565b602082019050919050565b60006020820190508181036000830152611419816113dd565b9050919050565b7f4552525f4e4f545f464f554e4400000000000000000000000000000000000000600082015250565b6000611456600d836113a3565b915061146182611420565b602082019050919050565b6000602082019050818103600083015261148581611449565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561151e578082015181840152602081019050611503565b60008484015250505050565b6000611535826114ea565b61153f81856114f5565b935061154f818560208601611500565b80840191505092915050565b6000611567828461152a565b915081905092915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6115c58261157c565b810181811067ffffffffffffffff821117156115e4576115e361158d565b5b80604052505050565b60006115f76110a2565b905061160382826115bc565b919050565b600067ffffffffffffffff8211156116235761162261158d565b5b61162c8261157c565b9050602081019050919050565b600061164c61164784611608565b6115ed565b90508281526020810184848401111561166857611667611577565b5b611673848285611500565b509392505050565b600082601f8301126116905761168f611572565b5b81516116a0848260208601611639565b91505092915050565b6000602082840312156116bf576116be6110ac565b5b600082015167ffffffffffffffff8111156116dd576116dc6110b1565b5b6116e98482850161167b565b91505092915050565b7f4552525f544f4b454e5f53594d424f4c5f544f4f5f4c4f4e4700000000000000600082015250565b60006117286019836113a3565b9150611733826116f2565b602082019050919050565b600060208201905081810360008301526117578161171b565b9050919050565b6000819050602082019050919050565b600061177a8251611289565b80915050919050565b60008160020a8302905092915050565b600061179e826114ea565b826117a88461175e565b90506117b38161176e565b925060208210156117f3576117ee7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802611783565b831692505b5050919050565b6000611805826111fc565b9150611810836111fc565b925082820190508082111561182857611827611340565b5b9291505056fea264697066735822122044b20aedb83f940e8885b9693e4ee4776635417706ff96023627700fd69c01fb64736f6c63430008120033 +\ No newline at end of file diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.json b/python/eth_token_index/data/TokenUniqueSymbolIndex.json @@ -1 +1 @@ -[{"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":[],"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"}] +[{"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":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","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"}] 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":[],"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":"0x2a6fff0204fcb0f35a4995b0679ed49bf3044e15956122f5aaaeeb95f9f61fd4","license":"AGPL-3.0-or-later","urls":["bzz-raw://1180f1d3ab2a9791db5cadf8637baaf6719d8089af03307e59a6c2b0ec70a2c4","dweb:/ipfs/QmWczv5ERbmVFBUbWdW87afzDbXsq31FtuujpJ3vyWk9WL"]}},"version":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":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","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":"0x7ab6b392718181f82a79bb425715f39e77d191678a2b544cb3e72f0385a384fe","license":"AGPL-3.0-or-later","urls":["bzz-raw://3bcff1c12c6b3dbf96e43e7413958ef6336de0afb7dfd20b1d003c742b05ea5b","dweb:/ipfs/QmNwTu4Fjji8ewpNsMtivGEiwgdzvWEhdFYrWePQ7KPENG"]}},"version":1} diff --git a/solidity/TokenUniqueSymbolIndex.sol b/solidity/TokenUniqueSymbolIndex.sol @@ -3,17 +3,18 @@ pragma solidity >=0.8.0; // SPDX-License-Identifier: AGPL-3.0-or-later contract TokenUniqueSymbolIndex { - - // EIP 173 - address public owner; mapping(address => bool) isWriter; - mapping ( bytes32 => uint256 ) registry; - //address[] tokenIndex; mapping ( address => bytes32 ) tokenIndex; address[] tokens; // Implements EIP173 + address public owner; + + // Implements Registry + bytes32[] public identifiers; + + // Implements EIP173 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // Implements AccountsIndex @@ -70,7 +71,9 @@ contract TokenUniqueSymbolIndex { registry[token_symbol_key] = tokens.length; tokens.push(_token); + identifiers.push(token_symbol_key); tokenIndex[_token] = token_symbol_key; + emit AddressKey(token_symbol_key, _token); emit AddressAdded(_token); return true; @@ -94,6 +97,7 @@ contract TokenUniqueSymbolIndex { i = registry[tokenIndex[_token]]; if (i < l) { tokens[i] = tokens[l]; + identifiers[i] = identifiers[l]; } tokens.pop(); registry[tokenIndex[_token]] = 0; @@ -152,6 +156,11 @@ contract TokenUniqueSymbolIndex { return true; } + // Implements Registry + function identifierCount() public view returns(uint256) { + return identifiers.length; + } + // Implements EIP165 function supportsInterface(bytes4 _sum) public pure returns (bool) { if (_sum == 0x12625fe5) { // Registry