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
Error on "transfer" call from a contract to a proxy contract
Description
When you have two contracts deployed with proxies, and when one of them tries to call the other one to attempt a transfer, it fails, apparently it runs out of gas. Polygon edge sets a gas of 2300 when doing this, which is correct for a transfer, but for some reason it's not working as expected. Increasing the gas assigned there seems to work but is not a good solution.
When making a "call" instead of a "transfer" it works fine.
Your environment
Mac OS 14.0, also ubuntu 20.04
Polygon edge v1.3.1, v0.6.3, v0.6.1 (tried it on those versions)
Branch Develop
Locally and on AWS cloud.
Locally runs on docker, runs natively on AWS.
Steps to reproduce
Deploy two contracts behind proxies, one contract calls the other one performing a transfer.
i.e.:
Contract 1:
function withdrawFromTest2usingTransfer(
Test2 test2Address,
uint256amount
) public {
test2Address.withdrawFromTest2usingTransfer(
payable(address(this)),
amount
);
emitEthReceived(amount);
}
Contract 2:
function withdrawFromTest2usingTransfer(
address payablerecipientAddress,
uint256amount
) public {
recipientAddress.transfer(amount);
}
Hi @goran-ethernal , thank you for answering.
The contract 1 is behind a proxy, I call the contract1Proxy function that calls the contract 2 which is not behind a proxy, then contract2 makes a transfer to the address of contract1Proxy.
You can see an example on this repo https://github.com/NicolasMenendez/poc-polygon-edge.
We tested the same code on other networks and it works just fine.
Error on "transfer" call from a contract to a proxy contract
Description
When you have two contracts deployed with proxies, and when one of them tries to call the other one to attempt a transfer, it fails, apparently it runs out of gas. Polygon edge sets a gas of 2300 when doing this, which is correct for a transfer, but for some reason it's not working as expected. Increasing the gas assigned there seems to work but is not a good solution.
When making a "call" instead of a "transfer" it works fine.
Your environment
Steps to reproduce
i.e.:
Contract 1:
Contract 2:
Expected behavior
Logs
Provide us with debug logs from all of your validators by setting logging to
debug
output with:server --log-level debug
Proposed solution
If you have an idea on how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered: