From 3b7bf3e773c3425a4ae3f1f736a1c047dc9d802c Mon Sep 17 00:00:00 2001 From: lash Date: Tue, 21 Mar 2023 17:03:09 +0000 Subject: [PATCH] Add contract metadata --- python/CHANGELOG | 2 ++ .../data/AddressDeclarator.metadata.json | 1 + python/setup.cfg | 4 +-- solidity/Makefile | 31 ++++++++++--------- solidity/TokenUniqueSymbolIndex.bin | 1 - solidity/TokenUniqueSymbolIndex.json | 1 - 6 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 python/eth_address_declarator/data/AddressDeclarator.metadata.json delete mode 100644 solidity/TokenUniqueSymbolIndex.bin delete mode 100644 solidity/TokenUniqueSymbolIndex.json diff --git a/python/CHANGELOG b/python/CHANGELOG index 58d2ba6..58ab89a 100644 --- a/python/CHANGELOG +++ b/python/CHANGELOG @@ -1,3 +1,5 @@ +- 0.6.3 + * Add contract metadata - 0.6.2 * Remove haveDeclaration solidity method - 0.6.1 diff --git a/python/eth_address_declarator/data/AddressDeclarator.metadata.json b/python/eth_address_declarator/data/AddressDeclarator.metadata.json new file mode 100644 index 0000000..46b3b8e --- /dev/null +++ b/python/eth_address_declarator/data/AddressDeclarator.metadata.json @@ -0,0 +1 @@ +{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"bytes32","name":"_initialDescription","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_declarator","type":"address"},{"indexed":false,"internalType":"address","name":"_subject","type":"address"},{"indexed":false,"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"DeclarationAdded","type":"event"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_proof","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contents","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"address","name":"_subject","type":"address"}],"name":"declaration","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declarationAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_declarator","type":"address"}],"name":"declarationCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"},{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"declaratorAddressAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"declaratorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"AddressDeclarator.sol":"AddressDeclarator"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"AddressDeclarator.sol":{"keccak256":"0x0d94ef0085d30619c4fc9b9c2d41311b9a09f5c8e97703543bf306fa91ff2d42","license":"GPL-3.0-or-later","urls":["bzz-raw://5c04e0113c939394f4c687c87214f3b1fda3647dbeab5ce49ce7182db5b0d36f","dweb:/ipfs/QmQ5i8JcF1MKNsVsZfwXKuGTJqrn6TJqBBKtpvL885xSL2"]}},"version":1} diff --git a/python/setup.cfg b/python/setup.cfg index ae75f6a..642ed20 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-address-index -version = 0.6.2 +version = 0.6.3 description = Signed metadata declarations for ethereum addresses author = Louis Holbrook author_email = dev@holbrook.no @@ -22,7 +22,7 @@ licence_files = [options] include_package_data = True -python_requires = >= 3.6 +python_requires = >= 3.7 packages = eth_address_declarator eth_address_declarator.runnable diff --git a/solidity/Makefile b/solidity/Makefile index a28962b..f10369b 100644 --- a/solidity/Makefile +++ b/solidity/Makefile @@ -1,30 +1,33 @@ SOLC = /usr/bin/solc -all: address_declarator token_index accounts_index +#all: address_declarator token_index accounts_index +all: address_declarator address_declarator: $(SOLC) AddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > AddressDeclarator.json $(SOLC) AddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > AddressDeclarator.bin + $(SOLC) AddressDeclarator.sol --metadata --evm-version byzantium | awk 'NR>3' > AddressDeclarator.metadata.json truncate -s -1 AddressDeclarator.bin -token_index: - $(SOLC) TokenUniqueSymbolIndexAddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > TokenUniqueSymbolIndexAddressDeclarator.json - $(SOLC) TokenUniqueSymbolIndexAddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > TokenUniqueSymbolIndexAddressDeclarator.bin - truncate -s -1 TokenUniqueSymbolIndexAddressDeclarator.bin - - -accounts_index: - $(SOLC) AccountsIndexAddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > AccountsIndexAddressDeclarator.json - $(SOLC) AccountsIndexAddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > AccountsIndexAddressDeclarator.bin - truncate -s -1 AccountsIndexAddressDeclarator.bin +#token_index: +# $(SOLC) TokenUniqueSymbolIndexAddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > TokenUniqueSymbolIndexAddressDeclarator.json +# $(SOLC) TokenUniqueSymbolIndexAddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > TokenUniqueSymbolIndexAddressDeclarator.bin +# truncate -s -1 TokenUniqueSymbolIndexAddressDeclarator.bin +# +# +#accounts_index: +# $(SOLC) AccountsIndexAddressDeclarator.sol --abi --evm-version byzantium | awk 'NR>3' > AccountsIndexAddressDeclarator.json +# $(SOLC) AccountsIndexAddressDeclarator.sol --bin --evm-version byzantium | awk 'NR>3' > AccountsIndexAddressDeclarator.bin +# truncate -s -1 AccountsIndexAddressDeclarator.bin #test: all #python test.py #python test_tokenindex.py install: all - cp -v AddressDeclarator.{json,bin} ../python/eth_address_declarator/data/ - cp -v TokenUniqueSymbolIndexAddressDeclarator.{json,bin} ../python/eth_address_declarator/data/ - cp -v AccountsIndexAddressDeclarator.{json,bin} ../python/eth_address_declarator/data/ + cp -v *.json ../python/eth_address_declarator/data/ + cp -v *.bin ../python/eth_address_declarator/data/ + #cp -v TokenUniqueSymbolIndexAddressDeclarator.{json,bin} ../python/eth_address_declarator/data/ + #cp -v AccountsIndexAddressDeclarator.{json,bin} ../python/eth_address_declarator/data/ .PHONY: test install diff --git a/solidity/TokenUniqueSymbolIndex.bin b/solidity/TokenUniqueSymbolIndex.bin deleted file mode 100644 index 1a97a8a..0000000 --- a/solidity/TokenUniqueSymbolIndex.bin +++ /dev/null @@ -1 +0,0 @@ -60806040523480156200001157600080fd5b50604051620013f0380380620013f08339818101604052810190620000379190620000d6565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200015b565b600081519050620000d08162000141565b92915050565b600060208284031215620000ef57620000ee6200013c565b5b6000620000ff84828501620000bf565b91505092915050565b600062000115826200011c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b6200014c8162000108565b81146200015857600080fd5b50565b611285806200016b6000396000f3fe608060405234801561001057600080fd5b50600436106100c6576000357c01000000000000000000000000000000000000000000000000000000009004806379ba50971161008e57806379ba5097146101975780637ef50298146101b55780638da5cb5b146101e5578063bb34534c14610203578063e2095c0714610233578063f2fde38b14610263576100c6565b806301ffc9a7146100cb5780630a3b0a4f146100fb5780630cbb0f831461012b578063370f91fb146101495780634420e48614610167575b600080fd5b6100e560048036038101906100e09190610dc8565b610293565b6040516100f29190610f33565b60405180910390f35b61011560048036038101906101109190610d41565b61043e565b6040516101229190610f33565b60405180910390f35b610133610450565b6040516101409190610f4e565b60405180910390f35b610151610469565b60405161015e9190610eef565b60405180910390f35b610181600480360381019061017c9190610d41565b61048f565b60405161018e9190610f33565b60405180910390f35b61019f610935565b6040516101ac9190610f33565b60405180910390f35b6101cf60048036038101906101ca9190610d6e565b610ad7565b6040516101dc9190610f4e565b60405180910390f35b6101ed610aef565b6040516101fa9190610eef565b60405180910390f35b61021d60048036038101906102189190610d6e565b610b13565b60405161022a9190610eef565b60405180910390f35b61024d60048036038101906102489190610e3e565b610b73565b60405161025a9190610eef565b60405180910390f35b61027d60048036038101906102789190610d41565b610bc7565b60405161028a9190610f33565b60405180910390f35b600063cbdb05c77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156102e85760019050610439565b63bb34534c7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561033b5760019050610439565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561038e5760019050610439565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156103e15760019050610439565b6337a47be47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104345760019050610439565b600090505b919050565b60006104498261048f565b9050919050565b60006001600480549050610464919061102b565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ea57600080fd5b60006060806000808673ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f95d89b41000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105999190610ed8565b6000604051808303816000865af19150503d80600081146105d6576040519150601f19603f3d011682016040523d82523d6000602084013e6105db565b606091505b508095508196505050846105ee57600080fd5b838060200190518101906106029190610df5565b92506002836040516106149190610ed8565b602060405180830381855afa158015610631573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906106549190610d9b565b9150600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1687836040516024016106a2929190610f0a565b6040516020818303038152906040527fae47ece0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161072c9190610ed8565b6000604051808303816000865af19150503d8060008114610769576040519150601f19603f3d011682016040523d82523d6000602084013e61076e565b606091505b5080955081965050508461078157600080fd5b60017f01000000000000000000000000000000000000000000000000000000000000000284601f815181106107b9576107b8611170565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461082f57600080fd5b600360008381526020019081526020016000205490506000811461085257600080fd5b60048054905060036000848152602001908152602001600020819055506004879080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004805490506108e4919061102b565b8773ffffffffffffffffffffffffffffffffffffffff167f9cc987676e7d63379f176ea50df0ae8d2d9d1141d1231d4ce15b5965f73c943060405160405180910390a3600195505050505050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461099257600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35090565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806003600084815260200190815260200160002054905060048181548110610b4057610b3f611170565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b60006004600183610b849190610fd5565b81548110610b9557610b94611170565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c2257600080fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6000610c7b610c7684610f8e565b610f69565b905082815260208101848484011115610c9757610c966111d3565b5b610ca28482856110dd565b509392505050565b600081359050610cb9816111f3565b92915050565b600081359050610cce8161120a565b92915050565b600081519050610ce38161120a565b92915050565b600081359050610cf881611221565b92915050565b600082601f830112610d1357610d126111ce565b5b8151610d23848260208601610c68565b91505092915050565b600081359050610d3b81611238565b92915050565b600060208284031215610d5757610d566111dd565b5b6000610d6584828501610caa565b91505092915050565b600060208284031215610d8457610d836111dd565b5b6000610d9284828501610cbf565b91505092915050565b600060208284031215610db157610db06111dd565b5b6000610dbf84828501610cd4565b91505092915050565b600060208284031215610dde57610ddd6111dd565b5b6000610dec84828501610ce9565b91505092915050565b600060208284031215610e0b57610e0a6111dd565b5b600082015167ffffffffffffffff811115610e2957610e286111d8565b5b610e3584828501610cfe565b91505092915050565b600060208284031215610e5457610e536111dd565b5b6000610e6284828501610d2c565b91505092915050565b610e748161105f565b82525050565b610e8381611071565b82525050565b610e928161107d565b82525050565b6000610ea382610fbf565b610ead8185610fca565b9350610ebd8185602086016110dd565b80840191505092915050565b610ed2816110d3565b82525050565b6000610ee48284610e98565b915081905092915050565b6000602082019050610f046000830184610e6b565b92915050565b6000604082019050610f1f6000830185610e6b565b610f2c6020830184610e89565b9392505050565b6000602082019050610f486000830184610e7a565b92915050565b6000602082019050610f636000830184610ec9565b92915050565b6000610f73610f84565b9050610f7f8282611110565b919050565b6000604051905090565b600067ffffffffffffffff821115610fa957610fa861119f565b5b610fb2826111e2565b9050602081019050919050565b600081519050919050565b600081905092915050565b6000610fe0826110d3565b9150610feb836110d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156110205761101f611141565b5b828201905092915050565b6000611036826110d3565b9150611041836110d3565b92508282101561105457611053611141565b5b828203905092915050565b600061106a826110b3565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156110fb5780820151818401526020810190506110e0565b8381111561110a576000848401525b50505050565b611119826111e2565b810181811067ffffffffffffffff821117156111385761113761119f565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b6111fc8161105f565b811461120757600080fd5b50565b6112138161107d565b811461121e57600080fd5b50565b61122a81611087565b811461123557600080fd5b50565b611241816110d3565b811461124c57600080fd5b5056fea264697066735822122071745d252f96fbcc5df17dbb1589d6a37040a8cdd17b00753e7b8fe27ac7e36264736f6c63430008070033 \ No newline at end of file diff --git a/solidity/TokenUniqueSymbolIndex.json b/solidity/TokenUniqueSymbolIndex.json deleted file mode 100644 index 19d6c49..0000000 --- a/solidity/TokenUniqueSymbolIndex.json +++ /dev/null @@ -1 +0,0 @@ -[{"inputs":[{"internalType":"address","name":"_addressDeclaratorAddress","type":"address"}],"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":[],"name":"addressDeclaratorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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"}]