Interface and abi generator interface

This commit is contained in:
lash 2023-06-09 09:44:03 +01:00
parent 45ca79cf46
commit 64e8df2573
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
91 changed files with 358 additions and 14 deletions

View File

@ -45,7 +45,10 @@ readme:
pandoc -f docbook -t gfm doc/texinfo/build/docbook.xml > README.md pandoc -f docbook -t gfm doc/texinfo/build/docbook.xml > README.md
cp -v README.md python/README.md cp -v README.md python/README.md
python: python: outs
mkdir -vp python/cic_contracts/data
cp -v solidity/*.interface python/cic_contracts/data
cp -v solidity/*.json python/cic_contracts/data
make -C python make -C python
.PHONY: clean install .PHONY: clean install

View File

@ -0,0 +1,8 @@
# local imports
from cic_contracts.search import search
from cic_contracts.names import Name
erc165_for = search
def abi(v):
return search(v, ext='json')

View File

@ -0,0 +1 @@
b7bca625

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_idx","type":"uint256"},{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressAdded","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"have","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
9479f0ae

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"bool","name":"_active","type":"bool"}],"name":"AddressActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_account","type":"address"}],"name":"AddressRemoved","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"activate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deactivate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"remove","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
b1110c1b

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_burned","type":"uint256"}],"name":"Burn","type":"event"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
869f7594

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_oldCap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newCap","type":"uint256"}],"name":"Cap","type":"event"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
4db1ccd4

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"createTime","outputs":[{"internalType":"int64","name":"","type":"int64"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
21b7493b

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_declarator","type":"address"},{"indexed":true,"internalType":"address","name":"_subject","type":"address"},{"indexed":true,"internalType":"bytes32","name":"_topic","type":"bytes32"},{"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"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"name":"addDeclaration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"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":"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":"address","name":"_subject","type":"address"},{"internalType":"bytes32","name":"_topic","type":"bytes32"}],"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"}]

View File

@ -0,0 +1 @@
982ab05d

View File

@ -0,0 +1 @@
[{"inputs":[],"name":"defaultDigestEncoding","outputs":[{"internalType":"uint256","name":"_encoding","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"uint256","name":"_encoding","type":"uint256"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"haveDigestEncoding","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
01ffc9a7

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]

View File

@ -0,0 +1 @@
9493f8b2

View File

@ -0,0 +1 @@
[{"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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
b61bc941

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_holder","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
7a0cdf92

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"endTime","outputs":[{"internalType":"int64","name":"","type":"int64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"startTime","outputs":[{"internalType":"int64","name":"","type":"int64"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
b45a3c0e

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
d0017968

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
cce39764

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
c22876c3

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"}]

View File

@ -0,0 +1 @@
dd9d2087

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
d283ef1d

View File

@ -0,0 +1 @@
[{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
150b7a02

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
841a0e94

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"Expired","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_oldTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newTimestamp","type":"uint256"}],"name":"ExpiryChange","type":"event"},{"inputs":[],"name":"applyExpiry","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expires","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
1a3ac634

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetAmountChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Give","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gimme","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"nextBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"nextTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
ed75b333

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"toURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"toURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
5878bcf4

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_minter","type":"address"},{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Mint","type":"event"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"mintTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
a3002595

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"_msgDigest","type":"bytes"}],"name":"Msg","type":"event"},{"inputs":[],"name":"getMsg","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
cd8391b0

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"digestCodec","outputs":[{"components":[{"internalType":"uint8","name":"l","type":"uint8"},{"internalType":"uint8","name":"codecRLength","type":"uint8"},{"internalType":"uint8","name":"prefixRLength","type":"uint8"},{"internalType":"bytes16","name":"prefix","type":"bytes16"},{"internalType":"bytes8","name":"codec","type":"bytes8"}],"internalType":"struct IMultiHash.MultiHash","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"},{"internalType":"bytes","name":"_digest","type":"bytes"}],"name":"encodeDigest","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_codec","type":"uint256"}],"name":"haveDigestEncoding","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
52e86958

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"executeOfflineRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"isOfflineValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verifyOfflineRequest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
37a47be4

View File

@ -0,0 +1 @@
[{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
6b578339

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_result","type":"address"}],"name":"OwnershipTaken","type":"event"},{"inputs":[{"internalType":"address","name":"_target","type":"address"}],"name":"takeOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
d719b0cc

View File

@ -0,0 +1 @@
[{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"bind","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"set","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
effbf671

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddressKey","type":"event"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","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"}]

View File

@ -0,0 +1 @@
0d7491f8

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"_final","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_sealState","type":"uint256"}],"name":"SealStateChange","type":"event"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1 @@
8a13249c

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenIdx","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_supply","type":"uint256"},{"indexed":false,"internalType":"address","name":"_token","type":"address"}],"name":"TokenCreated","type":"event"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"withdrawFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
ac3142f7

View File

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_blockDeadline","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"voteTargetPpm","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_proposalIdx","type":"uint256"}],"name":"ProposalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_proposalIdx","type":"uint256"},{"indexed":true,"internalType":"bool","name":"_cancelled","type":"bool"},{"indexed":true,"internalType":"bool","name":"_insufficient","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_totalVote","type":"uint256"}],"name":"ProposalCompleted","type":"event"},{"inputs":[],"name":"finalize","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalIdx","type":"uint256"},{"internalType":"uint256","name":"_optionIdx","type":"uint256"}],"name":"getOption","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalIdx","type":"uint256"}],"name":"optionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_description","type":"bytes32"},{"internalType":"uint256","name":"_blockWait","type":"uint256"},{"internalType":"uint24","name":"_targetVotePpm","type":"uint24"}],"name":"propose","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_description","type":"bytes32"},{"internalType":"bytes32[]","name":"_options","type":"bytes32[]"},{"internalType":"uint256","name":"_blockWait","type":"uint256"},{"internalType":"uint24","name":"_targetVotePpm","type":"uint24"}],"name":"proposeMulti","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"vote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"voteCancel","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proposalIdx","type":"uint256"},{"internalType":"uint256","name":"_optionIdx","type":"uint256"}],"name":"voteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_optionIndex","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"voteOption","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

View File

@ -0,0 +1 @@
abe1f1f5

View File

@ -0,0 +1 @@
[{"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":"_writer","type":"address"}],"name":"addWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"deleteWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_writer","type":"address"}],"name":"isWriter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

View File

@ -0,0 +1,4 @@
# standard imports
import os
data_dir = os.path.dirname(os.path.realpath(__file__))

View File

@ -0,0 +1,10 @@
# standard imports
import enum
class Name(enum.Enum):
WRITER = "Writer"
EXPIRE = "Expire"
SEAL = "Seal"
CAPPED = "Capped"
MINTER = "Minter"
BURNER = "Burner"

View File

@ -0,0 +1,16 @@
# standard imports
import os
# local imports
from cic_contracts.data import data_dir
from cic_contracts.names import Name
def search(v, ext='interface', search_dir=data_dir):
if isinstance(v, Name):
v = v.value
fp = os.path.join(search_dir, v + '.' + ext)
f = open(fp, 'r')
r = f.read()
f.close()
return r.rstrip()

View File

@ -1,13 +1,17 @@
# standard imports # standard imports
import os import os
# local imports
from cic_contracts.search import search
from cic_contracts import Name
cic_unittest_dir = os.path.dirname(os.path.realpath(__file__)) cic_unittest_dir = os.path.dirname(os.path.realpath(__file__))
contracts_dir = os.path.join(cic_unittest_dir, 'solidity') contracts_dir = os.path.join(cic_unittest_dir, 'solidity')
def bytecode(v): def bytecode(v):
fp = os.path.join(contracts_dir, v.capitalize() + 'Test.bin') if isinstance(v, Name):
f = open(fp, 'r') v = v.value
r = f.read() return search(v + 'Test', ext='bin', search_dir=contracts_dir)
f.close()
return r

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b5060405161070438038061070483398181016040528101906100329190610081565b8060008190555080600281905550506100ae565b600080fd5b6000819050919050565b61005e8161004b565b811461006957600080fd5b50565b60008151905061007b81610055565b92915050565b60006020828403121561009757610096610046565b5b60006100a58482850161006c565b91505092915050565b610647806100bd6000396000f3fe608060405234801561001057600080fd5b506004361061007f576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a71461008457806342966c68146100b457806344d17187146100e457806344df8e7014610100578063a2309ff81461011e578063d89135cd1461013c575b600080fd5b61009e60048036038101906100999190610353565b61015a565b6040516100ab919061039b565b60405180910390f35b6100ce60048036038101906100c991906103ec565b61020a565b6040516100db919061039b565b60405180910390f35b6100fe60048036038101906100f991906104dc565b61021f565b005b61010861022f565b604051610115919061055f565b60405180910390f35b610126610241565b604051610133919061055f565b60405180910390f35b610144610247565b604051610151919061055f565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101ae5760019050610205565b63bc4babdd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102005760019050610205565b600090505b919050565b60006102158261024d565b5060019050919050565b6102288361020a565b5050505050565b600061023c60005461024d565b905090565b60005481565b60015481565b6000808260025461025e91906105a9565b101561026957600080fd5b816001600082825461027b91906105dd565b92505081905550816002600082825461029491906105a9565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040516102e1919061055f565b60405180910390a2819050919050565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610330816102fb565b811461033b57600080fd5b50565b60008135905061034d81610327565b92915050565b600060208284031215610369576103686102f1565b5b60006103778482850161033e565b91505092915050565b60008115159050919050565b61039581610380565b82525050565b60006020820190506103b0600083018461038c565b92915050565b6000819050919050565b6103c9816103b6565b81146103d457600080fd5b50565b6000813590506103e6816103c0565b92915050565b600060208284031215610402576104016102f1565b5b6000610410848285016103d7565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061044482610419565b9050919050565b61045481610439565b811461045f57600080fd5b50565b6000813590506104718161044b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261049c5761049b610477565b5b8235905067ffffffffffffffff8111156104b9576104b861047c565b5b6020830191508360018202830111156104d5576104d4610481565b5b9250929050565b600080600080606085870312156104f6576104f56102f1565b5b600061050487828801610462565b9450506020610515878288016103d7565b935050604085013567ffffffffffffffff811115610536576105356102f6565b5b61054287828801610486565b925092505092959194509250565b610559816103b6565b82525050565b60006020820190506105746000830184610550565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006105b4826103b6565b91506105bf836103b6565b92508282039050818111156105d7576105d661057a565b5b92915050565b60006105e8826103b6565b91506105f3836103b6565b925082820190508082111561060b5761060a61057a565b5b9291505056fea26469706673582212208cc8e912e94a09c49f6772a6a0bfcea389d65478dcee0b3e12fa669028b5567e64736f6c63430008130033

View File

@ -0,0 +1,50 @@
pragma solidity >=0.6.3;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract MinterTest {
uint256 public totalMinted;
uint256 public totalBurned;
uint256 balance;
event Burn(address indexed _burner, uint256 _burned);
constructor(uint256 _mintValue) {
totalMinted = _mintValue;
balance = _mintValue;
}
function burn(address _from, uint256 _value, bytes calldata _data) public {
_from;
_data;
burn(_value);
}
function burn(uint256 _value) public returns (bool) {
burnCore(_value);
return true;
}
function burnCore(uint256 _value) internal returns(uint256) {
require(balance - _value >= 0);
totalBurned += _value;
balance -= _value;
emit Burn(msg.sender, _value);
return _value;
}
function burn() public returns (uint256) {
return burnCore(totalMinted);
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0xbc4babdd) { // Burner
return true;
}
return false;
}
}

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b506040516104003803806104008339818101604052810190610032919061007a565b80600081905550506100a7565b600080fd5b6000819050919050565b61005781610044565b811461006257600080fd5b50565b6000815190506100748161004e565b92915050565b6000602082840312156100905761008f61003f565b5b600061009e84828501610065565b91505092915050565b61034a806100b66000396000f3fe608060405234801561001057600080fd5b506004361061005e576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a7146100635780636f8b44b014610093578063d5abeb01146100af575b600080fd5b61007d60048036038101906100789190610224565b6100cd565b60405161008a919061026c565b60405180910390f35b6100ad60048036038101906100a891906102bd565b61017d565b005b6100b76101c1565b6040516100c491906102f9565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101215760019050610178565b63869f75947c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101735760019050610178565b600090505b919050565b6000547f9722adea12ab7ef86fc45b88f0e0b567639e8dddaae60261e08c03d747fbbfe6826040516101af91906102f9565b60405180910390a28060008190555050565b60005481565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610201816101cc565b811461020c57600080fd5b50565b60008135905061021e816101f8565b92915050565b60006020828403121561023a576102396101c7565b5b60006102488482850161020f565b91505092915050565b60008115159050919050565b61026681610251565b82525050565b6000602082019050610281600083018461025d565b92915050565b6000819050919050565b61029a81610287565b81146102a557600080fd5b50565b6000813590506102b781610291565b92915050565b6000602082840312156102d3576102d26101c7565b5b60006102e1848285016102a8565b91505092915050565b6102f381610287565b82525050565b600060208201905061030e60008301846102ea565b9291505056fea26469706673582212202fae6928974c7d7b0aa39737c7a191972db33126d9966e893091aac145fd34c864736f6c63430008130033

View File

@ -0,0 +1,29 @@
pragma solidity >=0.6.3;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract CappedTest {
event Cap(uint256 indexed _oldCap, uint256 _newCap);
uint256 public maxSupply;
constructor(uint256 _supply) {
maxSupply = _supply;
}
function setMaxSupply(uint256 _supply) public {
emit Cap(maxSupply, _supply);
maxSupply = _supply;
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0x869f7594) { // Capped
return true;
}
return false;
}
}

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b506040516105143803806105148339818101604052810190610032919061007a565b80600081905550506100a7565b600080fd5b6000819050919050565b61005781610044565b811461006257600080fd5b50565b6000815190506100748161004e565b92915050565b6000602082840312156100905761008f61003f565b5b600061009e84828501610065565b91505092915050565b61045e806100b66000396000f3fe608060405234801561001057600080fd5b5060043610610069576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a71461006e57806332c270521461009e5780635f408c04146100ba578063b1cb0db3146100d8575b600080fd5b61008860048036038101906100839190610301565b6100f6565b6040516100959190610349565b60405180910390f35b6100b860048036038101906100b3919061039a565b6101a6565b005b6100c2610212565b6040516100cf91906103e3565b60405180910390f35b6100e061029e565b6040516100ed919061040d565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361014a57600190506101a1565b63841a0e947c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361019c57600190506101a1565b600090505b919050565b600160009054906101000a900460ff16156101c057600080fd5b60005481116101ce57600080fd5b6000547ff5bd6cb27a0006b5ea8618058a0d84719695cb6d984f4840bc1a54ca12ae4b7c82604051610200919061040d565b60405180910390a28060008190555050565b6000600160009054906101000a900460ff1615610232576001905061029b565b600054421015610245576000905061029b565b60018060006101000a81548160ff0219169083151502179055507ff80dbaea4785589e52984ca36a31de106adc77759539a5c7d92883bf49692fe94260405161028e919061040d565b60405180910390a1600190505b90565b60005481565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6102de816102a9565b81146102e957600080fd5b50565b6000813590506102fb816102d5565b92915050565b600060208284031215610317576103166102a4565b5b6000610325848285016102ec565b91505092915050565b60008115159050919050565b6103438161032e565b82525050565b600060208201905061035e600083018461033a565b92915050565b6000819050919050565b61037781610364565b811461038257600080fd5b50565b6000813590506103948161036e565b92915050565b6000602082840312156103b0576103af6102a4565b5b60006103be84828501610385565b91505092915050565b600060ff82169050919050565b6103dd816103c7565b82525050565b60006020820190506103f860008301846103d4565b92915050565b61040781610364565b82525050565b600060208201905061042260008301846103fe565b9291505056fea2646970667358221220b63ea2baf0ead38ab1ac33ec6425843f8242d5428057e132d8a123fc1846f25564736f6c63430008130033

View File

@ -0,0 +1,47 @@
pragma solidity >=0.6.3;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract ExpireTest {
uint256 public expires;
bool expired;
event Expired(uint256 _timestamp);
event ExpiryChange(uint256 indexed _oldTimestamp, uint256 _newTimestamp);
constructor(uint256 _timestamp) {
expires = _timestamp;
}
function setExpire(uint256 _timestamp) public {
require(!expired);
require(_timestamp > expires);
emit ExpiryChange(expires, _timestamp);
expires = _timestamp;
}
function applyExpiry() public returns(uint8) {
if (expired) {
return 1;
}
if (block.timestamp < expires) {
return 0;
}
expired = true;
emit Expired(block.timestamp);
return 1;
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0x841a0e94) { // Expire
return true;
}
return false;
}
}

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b50610653806100206000396000f3fe608060405234801561001057600080fd5b5060043610610074576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a714610079578063449a52f8146100a95780638832e6e3146100d957806394d008ef146100f5578063e3d670d714610111575b600080fd5b610093600480360381019061008e9190610353565b610141565b6040516100a0919061039b565b60405180910390f35b6100c360048036038101906100be919061044a565b6101f1565b6040516100d0919061039b565b60405180910390f35b6100f360048036038101906100ee91906104ef565b6102b7565b005b61010f600480360381019061010a91906104ef565b6102c8565b005b61012b60048036038101906101269190610563565b6102d9565b604051610138919061059f565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361019557600190506101ec565b635878bcf47c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101e757600190506101ec565b600090505b919050565b6000816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461024191906105e9565b925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8846040516102a5919061059f565b60405180910390a36001905092915050565b6102c184846101f1565b5050505050565b6102d284846101f1565b5050505050565b60006020528060005260406000206000915090505481565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610330816102fb565b811461033b57600080fd5b50565b60008135905061034d81610327565b92915050565b600060208284031215610369576103686102f1565b5b60006103778482850161033e565b91505092915050565b60008115159050919050565b61039581610380565b82525050565b60006020820190506103b0600083018461038c565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103e1826103b6565b9050919050565b6103f1816103d6565b81146103fc57600080fd5b50565b60008135905061040e816103e8565b92915050565b6000819050919050565b61042781610414565b811461043257600080fd5b50565b6000813590506104448161041e565b92915050565b60008060408385031215610461576104606102f1565b5b600061046f858286016103ff565b925050602061048085828601610435565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f8401126104af576104ae61048a565b5b8235905067ffffffffffffffff8111156104cc576104cb61048f565b5b6020830191508360018202830111156104e8576104e7610494565b5b9250929050565b60008060008060608587031215610509576105086102f1565b5b6000610517878288016103ff565b945050602061052887828801610435565b935050604085013567ffffffffffffffff811115610549576105486102f6565b5b61055587828801610499565b925092505092959194509250565b600060208284031215610579576105786102f1565b5b6000610587848285016103ff565b91505092915050565b61059981610414565b82525050565b60006020820190506105b46000830184610590565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006105f482610414565b91506105ff83610414565b9250828201905080821115610617576106166105ba565b5b9291505056fea2646970667358221220c34bf6d363f42169041e40ea19aaa4d82e75186dffd29b11557323de4adfbad564736f6c63430008130033

View File

@ -0,0 +1,35 @@
pragma solidity >=0.6.3;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract MinterTest {
mapping (address => uint256) public balance;
event Mint(address indexed _minter, address indexed _beneficiary, uint256 _value);
function mintTo(address _beneficiary, uint256 _value) public returns (bool) {
balance[_beneficiary] += _value;
emit Mint(msg.sender, _beneficiary, _value);
return true;
}
function mint(address _beneficiary, uint256 _value, bytes calldata _data) public {
_data;
mintTo(_beneficiary, _value);
}
function safeMint(address _beneficiary, uint256 _value, bytes calldata _data) public {
_data;
mintTo(_beneficiary, _value);
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0x5878bcf4) { // Minter
return true;
}
return false;
}
}

View File

@ -0,0 +1 @@
6080604052600760015534801561001557600080fd5b50610357806100256000396000f3fe608060405234801561001057600080fd5b5060043610610069576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a71461006e57806318cbbcfc1461009e57806331a5995d146100bc57806386fe212d146100da575b600080fd5b61008860048036038101906100839190610231565b6100f6565b6040516100959190610279565b60405180910390f35b6100a66101a6565b6040516100b391906102ad565b60405180910390f35b6100c46101ac565b6040516100d191906102ad565b60405180910390f35b6100f460048036038101906100ef91906102f4565b6101b2565b005b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361014a57600190506101a1565b630d7491f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361019c57600190506101a1565b600090505b919050565b60015481565b60005481565b600154600054106101c257600080fd5b80600080828254179250508190555050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61020e816101d9565b811461021957600080fd5b50565b60008135905061022b81610205565b92915050565b600060208284031215610247576102466101d4565b5b60006102558482850161021c565b91505092915050565b60008115159050919050565b6102738161025e565b82525050565b600060208201905061028e600083018461026a565b92915050565b6000819050919050565b6102a781610294565b82525050565b60006020820190506102c2600083018461029e565b92915050565b6102d181610294565b81146102dc57600080fd5b50565b6000813590506102ee816102c8565b92915050565b60006020828403121561030a576103096101d4565b5b6000610318848285016102df565b9150509291505056fea2646970667358221220eb9a297000efc4353967bd2b081f2209f60e2f28952208509dad9c63d64e06ae64736f6c63430008130033

View File

@ -0,0 +1,25 @@
pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract SealTest {
event SealStateChange(bool indexed _final, uint256 _sealState);
uint256 public sealState;
uint256 public maxSealState = 7;
function seal(uint256 _bits) public {
require(sealState < maxSealState);
sealState |= _bits;
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0x0d7491f8) { // Capped
return true;
}
return false;
}
}

View File

@ -0,0 +1 @@
608060405234801561001057600080fd5b506104da806100206000396000f3fe608060405234801561001057600080fd5b5060043610610069576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a71461006e5780632b29ba231461009e5780635ae06f7e146100ce578063da2824a8146100fe575b600080fd5b6100886004803603810190610083919061038c565b61012e565b60405161009591906103d4565b60405180910390f35b6100b860048036038101906100b3919061044d565b6101de565b6040516100c591906103d4565b60405180910390f35b6100e860048036038101906100e3919061044d565b6101fe565b6040516100f591906103d4565b60405180910390f35b6101186004803603810190610113919061044d565b610296565b60405161012591906103d4565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361018257600190506101d9565b63abe1f1f57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101d457600190506101d9565b600090505b919050565b60006020528060005260406000206000915054906101000a900460ff1681565b6000806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9002f14780245e47491e7a2caae4712e7cea2e298e4e76c6916845145b90a51c826040516102859190610489565b60405180910390a160019050919050565b600060016000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f6ff3aa2ea7b53070f6d9d07a445d338d89e8edef44250ffa8be19f53910d4a2e8260405161031e9190610489565b60405180910390a160019050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61036981610334565b811461037457600080fd5b50565b60008135905061038681610360565b92915050565b6000602082840312156103a2576103a161032f565b5b60006103b084828501610377565b91505092915050565b60008115159050919050565b6103ce816103b9565b82525050565b60006020820190506103e960008301846103c5565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061041a826103ef565b9050919050565b61042a8161040f565b811461043557600080fd5b50565b60008135905061044781610421565b92915050565b6000602082840312156104635761046261032f565b5b600061047184828501610438565b91505092915050565b6104838161040f565b82525050565b600060208201905061049e600083018461047a565b9291505056fea264697066735822122020b67ff87e5eb051bb72e8e0a6d713bfca71e048393fa9cf2024224ab72bf93164736f6c63430008130033

View File

@ -0,0 +1,33 @@
pragma solidity >=0.6.3;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
contract WriterTest {
mapping (address => bool ) public isWriter;
event WriterAdded(address _writer);
event WriterDeleted(address _writer);
function addWriter(address _writer) public returns (bool) {
isWriter[_writer] = true;
emit WriterAdded(_writer);
return true;
}
function deleteWriter(address _writer) public returns (bool) {
isWriter[_writer] = false;
emit WriterDeleted(_writer);
return true;
}
function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0x01ffc9a7) { // EIP165
return true;
}
if (_sum == 0xabe1f1f5) { // Writer
return true;
}
return false;
}
}

View File

@ -13,6 +13,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
# local imports # local imports
from eth_burner import EthBurner from eth_burner import EthBurner
@ -28,7 +29,7 @@ class TestEthBurner(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('burner') code = bytecode(Name.BURNER)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)

View File

@ -12,6 +12,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
logg = logging.getLogger(__name__) logg = logging.getLogger(__name__)
@ -26,7 +27,7 @@ class TestEthCapped(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('capped') code = bytecode(Name.CAPPED)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)

View File

@ -13,6 +13,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
contract_dir = os.path.join(script_dir, '..', '..', 'solidity') contract_dir = os.path.join(script_dir, '..', '..', 'solidity')
@ -28,7 +29,7 @@ class TestEthExpire(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('expire') code = bytecode(Name.EXPIRE)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)

View File

@ -13,6 +13,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
# local imports # local imports
from eth_minter import EthMinter from eth_minter import EthMinter
@ -31,7 +32,7 @@ class TestEthMinter(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('minter') code = bytecode(Name.MINTER)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)

View File

@ -12,6 +12,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
contract_dir = os.path.join(script_dir, '..', '..', 'solidity') contract_dir = os.path.join(script_dir, '..', '..', 'solidity')
@ -29,7 +30,7 @@ class TestEthSeal(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('seal') code = bytecode(Name.SEAL)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)
@ -42,6 +43,7 @@ class TestEthSeal(EthTesterCase):
r = self.conn.do(o) r = self.conn.do(o)
self.assertEqual(r['status'], 1) self.assertEqual(r['status'], 1)
self.address = r['contract_address'] self.address = r['contract_address']
self.contracts['seal'] = self.address
logg.debug('published seal test contract with hash {}'.format(r)) logg.debug('published seal test contract with hash {}'.format(r))

View File

@ -12,6 +12,7 @@ from chainlib.eth.tx import TxFormat
from chainlib.eth.contract import ABIContractEncoder from chainlib.eth.contract import ABIContractEncoder
from chainlib.eth.contract import ABIContractType from chainlib.eth.contract import ABIContractType
from cic_contracts.unittest import bytecode from cic_contracts.unittest import bytecode
from cic_contracts import Name
# local imports # local imports
from eth_writer import EthWriter from eth_writer import EthWriter
@ -32,7 +33,7 @@ class TestEthWriter(EthTesterCase):
self.conn = RPCConnection.connect(self.chain_spec, 'default') self.conn = RPCConnection.connect(self.chain_spec, 'default')
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn) nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
code = bytecode('writer') code = bytecode(Name.WRITER)
txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) txf = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
tx = txf.template(self.accounts[0], None, use_nonce=True) tx = txf.template(self.accounts[0], None, use_nonce=True)

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = cic-contracts name = cic-contracts
version = 0.3.6 version = 0.3.7
description = CIC network smart contract interfaces description = CIC network smart contract interfaces
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no
@ -26,9 +26,10 @@ licence_files =
[options] [options]
include_package_data = True include_package_data = True
python_requires = >= 3.8 python_requires = >=3.8,<3.11
packages = packages =
cic_contracts cic_contracts
cic_contracts.data
cic_contracts.unittest cic_contracts.unittest
eth_capped eth_capped
eth_capped.unittest eth_capped.unittest