Upgrade transferGas for Staking(BEP153): 2300 -> 5000

Hello

Overview:
I suggest increasing the value of “transferGas” for Staking.sol in order to use an upgradable contract as a staker.

Motivation:
Currently, the value of transferGas equals to 2300.
Code reference:

Simple send to smart contract that is deployed using proxy consumes 2747 gas, but Staking.sol allows to use only 2300 gas. It also works with Ethereum since it supports EIP2930(access lists). As a result, there is currently no way to use an upgradable contract as a staker in Staking.sol.

Also a re-entrancy attack makes sense if you can modify storage that costs 5k gas. Setting transferGas value less than 5k gas is safe for you.

Although the staking contract has protection of noRetrancy where we are using transferGas and passing to call. Still let the team test and simulate it with both a custom code and with a proxy contract. Just to estimate how much gas they are consuming in delegate, undelegate, redelgate and claim rewards.

2 Likes

2300 is not enough, 5000 could be fine, the operation to be executed with 5000 is quite limited.

Well noted and explained, it will be taken into consideration