If I'm aiming to reduce cost of an Arbitrum transaction, on calling a function that looks like this:
function hello(address param1, uint256 param2, uint256 param3) external;

could I write a "wrapper" contract that looks something like
contract wrapper {
address private constant ADDRESS = 0x132...;
uint256 private constant PARAM_2 = 123;
uint256 private constant PARAM_3 = 456;
function executeHello() external {
otherContract.hello(ADDRESS, 123, 456);
}
}

My thinking is it is reducing the top level calldata, but I'm not sure if the calldata for the internal transaction created from the external call to otherContract::hello cancels this out.

Mar 12, 2022, 2:26 AM
It will be more expensive to use a wrapper that makes the external call, probably on the order of 5000 extra gas.
Mar 12, 2022, 2:40 PM
Usually, but I specifically mentioned Arbitrum. I managed to cut the overall tx cost by 15%+ percent.
Mar 12, 2022, 8:28 PM
Ah nice, didn't notice you said arbitrum
Mar 12, 2022, 8:28 PM

© 2024 Draquery.com All rights reserved.