with networks.optimism.mainnet.use_default_provider():
contract = Contract(address=address,abi=json.loads(abi))
txn = multisend.MultiSend()
txn.add(contract.transfer,"0xxxxxxxxxxxxxxxx",1000000,delegatecall=True)
txn(sender=self.safe)
the code that caused the failure (see this link for help with formatting code)
The error props up in provider.py under the estimate_gas_cost where estimation fails, most likely it's related to txn_params being improperly configured for that gas estimation.
full output of the error you received
Traceback (most recent call last):
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/ape_ethereum/provider.py:240 in estimate_gas_cost
return self.web3.eth.estimate_gas(txn_params, block_identifier=block_id)
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/eth/eth.py:311 in estimate_gas
return self._estimate_gas(transaction, block_identifier)
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/module.py:75 in caller
result = w3.manager.request_blocking(
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/manager.py:326 in request_blocking
return self.formatted_response(
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/manager.py:287 in formatted_response
apply_error_formatters(error_formatters, response)
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/manager.py:104 in apply_error_formatters
formatted_resp = pipe(response, error_formatters)
File cytoolz/functoolz.pyx:680 in cytoolz.functoolz.pipe
File cytoolz/functoolz.pyx:655 in cytoolz.functoolz.c_pipe
File ~/miniconda3/envs/monitor/lib/python3.9/site-packages/web3/_utils/contract_error_handling.py:161 in raise_contract_logic_error_on_revert
raise ContractLogicError(message, data=data)
ContractLogicError: execution reverted: MultiSend should only be called via delegatecall
### How can it be fixed?
I changed switched the `to` in the tx_params variable, to the address of the contract being interacted with in the individual send, rather then the multisend and it seems to have not reverted in the multicall.
tx_params is as follows:
Environment information
ape
and plugin versions: 0.7.1$ ape plugins list
What went wrong?
Please include information like:
The error props up in
provider.py
under theestimate_gas_cost
where estimation fails, most likely it's related totxn_params
being improperly configured for that gas estimation.full output of the error you received
ContractLogicError: execution reverted: MultiSend should only be called via delegatecall
{'chainId': 10, 'to': '0x998739BFdAAdde7C933B942a68053933098f9EDa', 'from': 'MY_SAFE_ADDRESS', 'value': 0, 'data': '0x8d80ff0a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000079014200000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000242e1a7d4d000000000000000000000000000000000000000000000000000000000000006400000000000000', 'type': '0x02', 'maxFeePerGas': 5373609, 'maxPriorityFeePerGas': 1000000, 'accessList': []}