Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
update flatten and verify commands to use foundry instead of dapp.tools
Browse files Browse the repository at this point in the history
  • Loading branch information
SidestreamColdMelon committed Feb 13, 2024
1 parent 2db0206 commit 4ab9064
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ estimate :; ./scripts/estimate-deploy-gas.sh
deploy :; ./scripts/deploy.sh
deploy-info :; ./scripts/get-deploy-info.sh tx=$(tx)
verify :; ./scripts/verify.py DssSpell $(addr)
flatten :; hevm flatten --source-file "src/DssSpell.sol" > out/flat.sol
flatten :; forge flatten src/DssSpell.sol --output out/flat.sol
diff-deployed-spell :; ./scripts/diff-deployed-dssspell.sh $(spell)
check-deployed-spell :; ./scripts/check-deployed-dssspell.sh
cast-spell :; ./scripts/cast-dssspell.sh $(spell)
Expand Down
19 changes: 11 additions & 8 deletions scripts/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
exit('contract name not found.')

print('Obtaining chain... ')
seth_chain = subprocess.run(['seth', 'chain'], capture_output=True)
chain = seth_chain.stdout.decode('ascii').replace('\n', '')
cast_chain = subprocess.run(['cast', 'chain'], capture_output=True)
chain = cast_chain.stdout.decode('ascii').replace('\n', '')
print(chain)

text_metadata = content['contracts'][contract_path][contract_name]['metadata']
Expand All @@ -74,13 +74,16 @@
action = 'verifysourcecode'
code_format = 'solidity-single-file'

flatten = subprocess.run([
'hevm',
flatten_output_path = 'out/flat.sol'
subprocess.run([
'forge',
'flatten',
'--source-file',
contract_path
], capture_output=True)
code = flatten.stdout.decode('utf-8')
contract_path,
'--output',
flatten_output_path
])
with open(flatten_output_path, 'r', encoding='utf-8') as code_file:
code = code_file.read()

def get_block(signature, code, with_frame=False):
block_and_tail = code[code.find(signature) :]
Expand Down

0 comments on commit 4ab9064

Please sign in to comment.