From a18b5c093c3f46e38d9577ee5f5e46443b72c804 Mon Sep 17 00:00:00 2001 From: nolash Date: Sat, 23 Oct 2021 18:57:45 +0200 Subject: [PATCH] Reinstate simple token index contract --- .../data/TokenUniqueSymbolIndex.bin | 2 +- .../data/TokenUniqueSymbolIndex.json | 2 +- solidity/TokenUniqueSymbolIndex.sol | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.bin b/python/eth_token_index/data/TokenUniqueSymbolIndex.bin index 2bc51d8..54c92bc 100644 --- a/python/eth_token_index/data/TokenUniqueSymbolIndex.bin +++ b/python/eth_token_index/data/TokenUniqueSymbolIndex.bin @@ -1 +1 @@ -608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611021806100c46000396000f3fe608060405234801561001057600080fd5b50600436106100bb576000357c0100000000000000000000000000000000000000000000000000000000900480637ef50298116100835780637ef502981461018c5780638da5cb5b146101bc578063bb34534c146101da578063e2095c071461020a578063f2fde38b1461023a576100bb565b806301ffc9a7146100c05780630a3b0a4f146100f05780630cbb0f83146101205780634420e4861461013e57806379ba50971461016e575b600080fd5b6100da60048036038101906100d59190610b9c565b61026a565b6040516100e79190610ccf565b60405180910390f35b61010a60048036038101906101059190610b15565b610415565b6040516101179190610ccf565b60405180910390f35b610128610427565b6040516101359190610cea565b60405180910390f35b61015860048036038101906101539190610b15565b610440565b6040516101659190610ccf565b60405180910390f35b610176610709565b6040516101839190610ccf565b60405180910390f35b6101a660048036038101906101a19190610b42565b6108ab565b6040516101b39190610cea565b60405180910390f35b6101c46108c3565b6040516101d19190610cb4565b60405180910390f35b6101f460048036038101906101ef9190610b42565b6108e7565b6040516102019190610cb4565b60405180910390f35b610224600480360381019061021f9190610c12565b610947565b6040516102319190610cb4565b60405180910390f35b610254600480360381019061024f9190610b15565b61099b565b6040516102619190610ccf565b60405180910390f35b600063cbdb05c77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156102bf5760019050610410565b63bb34534c7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103125760019050610410565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103655760019050610410565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103b85760019050610410565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561040b5760019050610410565b600090505b919050565b600061042082610440565b9050919050565b6000600160038054905061043b9190610dc7565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461049b57600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161054a9190610c9d565b6000604051808303816000865af19150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b50915091508161059b57600080fd5b808060200190518101906105af9190610bc9565b94506002856040516105c19190610c9d565b602060405180830381855afa1580156105de573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906106019190610b6f565b9350600260008581526020019081526020016000205492506000831461062657600080fd5b60038054905060026000868152602001908152602001600020819055506003879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003805490506106b89190610dc7565b8773ffffffffffffffffffffffffffffffffffffffff167f9cc987676e7d63379f176ea50df0ae8d2d9d1141d1231d4ce15b5965f73c943060405160405180910390a3600195505050505050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461076657600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b60026020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600260008481526020019081526020016000205490506003818154811061091457610913610f0c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b600060036001836109589190610d71565b8154811061096957610968610f0c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109f657600080fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000610a4f610a4a84610d2a565b610d05565b905082815260208101848484011115610a6b57610a6a610f6f565b5b610a76848285610e79565b509392505050565b600081359050610a8d81610f8f565b92915050565b600081359050610aa281610fa6565b92915050565b600081519050610ab781610fa6565b92915050565b600081359050610acc81610fbd565b92915050565b600082601f830112610ae757610ae6610f6a565b5b8151610af7848260208601610a3c565b91505092915050565b600081359050610b0f81610fd4565b92915050565b600060208284031215610b2b57610b2a610f79565b5b6000610b3984828501610a7e565b91505092915050565b600060208284031215610b5857610b57610f79565b5b6000610b6684828501610a93565b91505092915050565b600060208284031215610b8557610b84610f79565b5b6000610b9384828501610aa8565b91505092915050565b600060208284031215610bb257610bb1610f79565b5b6000610bc084828501610abd565b91505092915050565b600060208284031215610bdf57610bde610f79565b5b600082015167ffffffffffffffff811115610bfd57610bfc610f74565b5b610c0984828501610ad2565b91505092915050565b600060208284031215610c2857610c27610f79565b5b6000610c3684828501610b00565b91505092915050565b610c4881610dfb565b82525050565b610c5781610e0d565b82525050565b6000610c6882610d5b565b610c728185610d66565b9350610c82818560208601610e79565b80840191505092915050565b610c9781610e6f565b82525050565b6000610ca98284610c5d565b915081905092915050565b6000602082019050610cc96000830184610c3f565b92915050565b6000602082019050610ce46000830184610c4e565b92915050565b6000602082019050610cff6000830184610c8e565b92915050565b6000610d0f610d20565b9050610d1b8282610eac565b919050565b6000604051905090565b600067ffffffffffffffff821115610d4557610d44610f3b565b5b610d4e82610f7e565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610d7c82610e6f565b9150610d8783610e6f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610dbc57610dbb610edd565b5b828201905092915050565b6000610dd282610e6f565b9150610ddd83610e6f565b925082821015610df057610def610edd565b5b828203905092915050565b6000610e0682610e4f565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610e97578082015181840152602081019050610e7c565b83811115610ea6576000848401525b50505050565b610eb582610f7e565b810181811067ffffffffffffffff82111715610ed457610ed3610f3b565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b610f9881610dfb565b8114610fa357600080fd5b50565b610faf81610e19565b8114610fba57600080fd5b50565b610fc681610e23565b8114610fd157600080fd5b50565b610fdd81610e6f565b8114610fe857600080fd5b5056fea26469706673582212201cbc4bf05e3ed0bb6e627801ab4486f9b8d966bf2e342645a13008d6bfddb33b64736f6c63430008070033 \ No newline at end of file +608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611254806100c46000396000f3fe608060405234801561001057600080fd5b50600436106100d1576000357c0100000000000000000000000000000000000000000000000000000000900480637ef502981161008e5780637ef50298146101d25780638da5cb5b14610202578063bb34534c14610220578063da2824a814610250578063e2095c0714610280578063f2fde38b146102b0576100d1565b806301ffc9a7146100d65780630a3b0a4f146101065780630cbb0f83146101365780634420e486146101545780635ae06f7e1461018457806379ba5097146101b4575b600080fd5b6100f060048036038101906100eb9190610dcf565b6102e0565b6040516100fd9190610f02565b60405180910390f35b610120600480360381019061011b9190610d48565b6104de565b60405161012d9190610f02565b60405180910390f35b61013e6104f0565b60405161014b9190610f1d565b60405180910390f35b61016e60048036038101906101699190610d48565b610509565b60405161017b9190610f02565b60405180910390f35b61019e60048036038101906101999190610d48565b6107cf565b6040516101ab9190610f02565b60405180910390f35b6101bc610881565b6040516101c99190610f02565b60405180910390f35b6101ec60048036038101906101e79190610d75565b610a23565b6040516101f99190610f1d565b60405180910390f35b61020a610a3b565b6040516102179190610ee7565b60405180910390f35b61023a60048036038101906102359190610d75565b610a5f565b6040516102479190610ee7565b60405180910390f35b61026a60048036038101906102659190610d48565b610abf565b6040516102779190610f02565b60405180910390f35b61029a60048036038101906102959190610e45565b610b7a565b6040516102a79190610ee7565b60405180910390f35b6102ca60048036038101906102c59190610d48565b610bce565b6040516102d79190610f02565b60405180910390f35b600063cbdb05c77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561033557600190506104d9565b63bb34534c7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561038857600190506104d9565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103db57600190506104d9565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561042e57600190506104d9565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561048157600190506104d9565b6380c84bd67c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104d457600190506104d9565b600090505b919050565b60006104e982610509565b9050919050565b600060016004805490506105049190610ffa565b905090565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661056157600080fd5b60606000806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516106109190610ed0565b6000604051808303816000865af19150503d806000811461064d576040519150601f19603f3d011682016040523d82523d6000602084013e610652565b606091505b50915091508161066157600080fd5b808060200190518101906106759190610dfc565b94506002856040516106879190610ed0565b602060405180830381855afa1580156106a4573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906106c79190610da2565b935060036000858152602001908152602001600020549250600083146106ec57600080fd5b60048054905060036000868152602001908152602001600020819055506004879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160048054905061077e9190610ffa565b8773ffffffffffffffffffffffffffffffffffffffff167f9cc987676e7d63379f176ea50df0ae8d2d9d1141d1231d4ce15b5965f73c943060405160405180910390a3600195505050505050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082957600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560019050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108de57600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806003600084815260200190815260200160002054905060048181548110610a8c57610a8b61113f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b1957600080fd5b6001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b60006004600183610b8b9190610fa4565b81548110610b9c57610b9b61113f565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c2957600080fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000610c82610c7d84610f5d565b610f38565b905082815260208101848484011115610c9e57610c9d6111a2565b5b610ca98482856110ac565b509392505050565b600081359050610cc0816111c2565b92915050565b600081359050610cd5816111d9565b92915050565b600081519050610cea816111d9565b92915050565b600081359050610cff816111f0565b92915050565b600082601f830112610d1a57610d1961119d565b5b8151610d2a848260208601610c6f565b91505092915050565b600081359050610d4281611207565b92915050565b600060208284031215610d5e57610d5d6111ac565b5b6000610d6c84828501610cb1565b91505092915050565b600060208284031215610d8b57610d8a6111ac565b5b6000610d9984828501610cc6565b91505092915050565b600060208284031215610db857610db76111ac565b5b6000610dc684828501610cdb565b91505092915050565b600060208284031215610de557610de46111ac565b5b6000610df384828501610cf0565b91505092915050565b600060208284031215610e1257610e116111ac565b5b600082015167ffffffffffffffff811115610e3057610e2f6111a7565b5b610e3c84828501610d05565b91505092915050565b600060208284031215610e5b57610e5a6111ac565b5b6000610e6984828501610d33565b91505092915050565b610e7b8161102e565b82525050565b610e8a81611040565b82525050565b6000610e9b82610f8e565b610ea58185610f99565b9350610eb58185602086016110ac565b80840191505092915050565b610eca816110a2565b82525050565b6000610edc8284610e90565b915081905092915050565b6000602082019050610efc6000830184610e72565b92915050565b6000602082019050610f176000830184610e81565b92915050565b6000602082019050610f326000830184610ec1565b92915050565b6000610f42610f53565b9050610f4e82826110df565b919050565b6000604051905090565b600067ffffffffffffffff821115610f7857610f7761116e565b5b610f81826111b1565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610faf826110a2565b9150610fba836110a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fef57610fee611110565b5b828201905092915050565b6000611005826110a2565b9150611010836110a2565b92508282101561102357611022611110565b5b828203905092915050565b600061103982611082565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156110ca5780820151818401526020810190506110af565b838111156110d9576000848401525b50505050565b6110e8826111b1565b810181811067ffffffffffffffff821117156111075761110661116e565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b6111cb8161102e565b81146111d657600080fd5b50565b6111e28161104c565b81146111ed57600080fd5b50565b6111f981611056565b811461120457600080fd5b50565b611210816110a2565b811461121b57600080fd5b5056fea26469706673582212200410037886d398256f47bc55da3c04cbb0b099bf38c318cbf03747dd2085520164736f6c63430008070033 \ No newline at end of file diff --git a/python/eth_token_index/data/TokenUniqueSymbolIndex.json b/python/eth_token_index/data/TokenUniqueSymbolIndex.json index 04e3a00..5993439 100644 --- 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":true,"internalType":"address","name":"addedAccount","type":"address"},{"indexed":true,"internalType":"uint256","name":"accountIndex","type":"uint256"}],"name":"AddressAdded","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":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"add","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":"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":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"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":"addedAccount","type":"address"},{"indexed":true,"internalType":"uint256","name":"accountIndex","type":"uint256"}],"name":"AddressAdded","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":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"_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":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/solidity/TokenUniqueSymbolIndex.sol b/solidity/TokenUniqueSymbolIndex.sol index fc208c2..bea011f 100644 --- a/solidity/TokenUniqueSymbolIndex.sol +++ b/solidity/TokenUniqueSymbolIndex.sol @@ -7,6 +7,7 @@ contract TokenUniqueSymbolIndex { // EIP 173 address public owner; address newOwner; + mapping(address => bool) writers; mapping ( bytes32 => uint256 ) public registry; address[] tokens; @@ -33,7 +34,7 @@ contract TokenUniqueSymbolIndex { } function register(address _token) public returns (bool) { - require(msg.sender == owner); + require(writers[msg.sender]); bytes memory token_symbol; bytes32 token_symbol_key; @@ -82,6 +83,19 @@ contract TokenUniqueSymbolIndex { emit OwnershipTransferred(oldOwner, owner); } + // Implements Writer + function addWriter(address _writer) public returns (bool) { + require(owner == msg.sender); + writers[_writer] = true; + return true; + } + + // Implements Writer + function deleteWriter(address _writer) public returns (bool) { + require(owner == msg.sender); + delete writers[_writer]; + return true; + } // Implements EIP165 function supportsInterface(bytes4 _sum) public pure returns (bool) { @@ -100,6 +114,9 @@ contract TokenUniqueSymbolIndex { if (_sum == 0x37a47be4) { // OwnedAccepter return true; } + if (_sum == 0x80c84bd6) { // Writer + return true; + } return false; } }