Move solidity source to subfolder

This commit is contained in:
nolash 2021-04-29 08:37:41 +02:00
parent 08040874ef
commit d15dabb4b5
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
10 changed files with 9 additions and 71 deletions

View File

@ -2,10 +2,10 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# File-version: 5
INPUTS = $(wildcard *.sol)
INPUTS = $(wildcard solidity/*.sol)
OUTPUTS_JSON = $(patsubst %.sol, %.json, $(INPUTS))
OUTPUTS_INTERFACE = $(patsubst %.sol, %.interface, $(INPUTS))
OUTPUTS = ${OUTPUTS_JSON} ${OUTPUTS_INTERFACE}
OUTPUTS = $(OUTPUTS_JSON) $(OUTPUTS_INTERFACE)
PREFIX = /usr/local/share/cic/solidity/abi
#%.abi.json: $(wildcard *.sol)
@ -20,12 +20,13 @@ PREFIX = /usr/local/share/cic/solidity/abi
bash to_interface.sh $(basename $@).sol > $@
all: $(OUTPUTS)
echo $(OUTPUTS)
install: $(OUTPUTS)
install -vDm0644 -t $(PREFIX) $?
clean:
rm -vf *.json
rm -vf *.interface
rm -vf solidity/*.json
rm -vf solidity/*.interface
.PHONY: clean install

View File

@ -5,8 +5,8 @@ import sys
# external imports
import sha3
#logging.basicConfig(level=logging.WARNING)
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.WARNING)
#logging.basicConfig(level=logging.DEBUG)
logg = logging.getLogger()
if __name__ == '__main__':

View File

@ -3,7 +3,7 @@ import logging
import ply.lex as lex
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()

View File

@ -1,44 +0,0 @@
import sys
from chainlib.eth.constant import ZERO_ADDRESS
from chainlib.eth.gas import DefaultGasOracle
from chainlib.eth.nonce import DefaultNonceOracle
from chainlib.eth.tx import TxFactory
from chainlib.eth.connection import HTTPConnection
from chainlib.eth.hash import keccak256_string_to_hex
from chainlib.eth.rpc import jsonrpc_template
from chainlib.eth.error import EthException
import eth_abi
from hexathon import (
strip_0x,
add_0x,
)
i = 0
while True:
conn = HTTPConnection('http://localhost:63545')
gas_oracle = DefaultGasOracle(conn)
nonce_oracle = DefaultNonceOracle(ZERO_ADDRESS, conn)
# Get Token registry address
txf = TxFactory(signer=None, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=8996)
tx = txf.template(ZERO_ADDRESS, sys.argv[1])
identifiers_method = keccak256_string_to_hex('identifiers(uint256)')[:8]
data = add_0x(identifiers_method)
data += eth_abi.encode_single('uint256', i).hex()
txf.set_code(tx, data)
o = jsonrpc_template()
o['method'] = 'eth_call'
tx = txf.normalize(tx)
o['params'].append(tx)
o['params'].append('latest')
try:
r = conn.do(o)
except EthException:
break
id_bytes = bytes.fromhex(strip_0x(r))
id_str = id_bytes[:id_bytes.find(b'\x00')]
print(id_str.decode('utf-8̈́'))
i += 1

View File

@ -3,7 +3,5 @@
d=`mktemp -d`
b=`basename $1`
s=${b%%.*}
echo $s
python3 reduce_to_methods.py $1 > $d/$b
python3 calculate_eip165.py $d/$b > ${s}.interface
>&2 echo $d/$b
python3 calculate_eip165.py $d/$b

View File

@ -1,17 +0,0 @@
import sys
import web3
f = open(sys.argv[1], 'r')
z = b''
for i in range(32):
z += b'\x00'
while True:
l = f.readline()
if l == '':
break
#print('line {}'.format(l))
h = web3.Web3.keccak(text=l)
z = bytes([a ^ b for a, b in zip(h, z)])
#print(h.hex(), z.hex())
f.close()
print(h[:4].hex())