Take these two contracts, both deployed on Kovan and with the source code verified:
- DSProxy: 0xa92Bed719071A4d33B0B348513E7e866a6ff6B3F
- TargetContract: 0xE3CD2e7a628b57d3e50c5f7B921182f676721bDF
And take this transaction:
Which has been reverted and I don't understand why.
I want to call the
execute(address,bytes) function of the
DSProxy and pass in the following arguments:
- 0xb081b4eb (the signature for the "wrapEth" function)
- Also send some amount of ETH
Effectively calling the wrapEth payable function defined in
TargetContract, but via the
DSProxy DELEGATECALL functionality.
With help from ethers.js, I generated the calldata for this multi-contract call, and it looks like this:
Unfortunately, when I relay this calldata to the Kovan testnet via MetaMask, MyCrypto or any other wallet, I am getting reverted transactions. Although I feel that the above calldata is correct, I tried tweaking the last part of the bytes (the function signature) in case there is a bug in Ethers, but with no luck.
Can you see the error here?