BalancerMaxis / bal_tools

1 stars 0 forks source link

safe tx builder module #12

Closed jalbrekt85 closed 2 months ago

jalbrekt85 commented 2 months ago

creates the safe payload json files with the familiar web3.py/brownie syntax. works for any number of contracts. see tests for examples

can now do something like:

from bal_tools.safe_tx_builder import SafeTxBuilder, SafeContract

builder = SafeTxBuilder(safe_address)
contract = SafeContract(address, abi)
contract.someMethod(input1, input2)
builder.output_payload() # -> outputs json payload you can feed directly into safe ui

there is also bal_addresses address resolution from their labels. this can be used on SafeTxBuilder init, SafeContract init and function inputs of address type. ex:

usdc = SafeContract("tokens/USDC", erc20_abi)