You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I want to call the method approve (described below) having the Safe as sender (tx['from']), effectively increasing the allowance given to the spender.
approve(address spender, uint256 amount) → bool
I might be confused about the Safe inner workings, but I don't think it's currently possible to have the Safe sign a transaction (please see steps to reproduce below).
To Reproduce
Steps to reproduce the behavior:
spender = "0x1234" # EOA account
wxDAI = web3.eth.contract(address=contract_address, abi=contract_abi)
tx_params = {}
tx_params["nonce"] = tx_params.get(
"nonce", web3.eth.get_transaction_count(from_address)
)
tx_params["from"] = SAFE_ADDRESS
approve_tx = wxDAI.functions.approve(
Web3.to_checksum_address(spender), # spender here is another EOA, e.g. my own address
int(1e18),
).build_transaction(tx_params)
signed_approve = w3.eth.account.sign_transaction(
approve_tx, private_key=SAFE_PRIVATE_KEY
)
approve_tx_hash = w3.eth.send_raw_transaction(signed_approve.rawTransaction)
Expected behavior
I expected the raw transaction to be submitted, but it's unclear how to complete transactions with a Safe's signature using web3py.
I appreciate your help in this topic.
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to call the method
approve
(described below) having the Safe as sender (tx['from']
), effectively increasing the allowance given to the spender.I might be confused about the Safe inner workings, but I don't think it's currently possible to have the Safe sign a transaction (please see steps to reproduce below).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected the raw transaction to be submitted, but it's unclear how to complete transactions with a Safe's signature using web3py.
I appreciate your help in this topic.
The text was updated successfully, but these errors were encountered: