Refactor getFee

This commit is contained in:
Gerardo Nardelli 2019-01-11 10:19:22 -03:00
parent c7d62b43e1
commit 8876e15fff
1 changed files with 11 additions and 1 deletions

View File

@ -188,7 +188,17 @@ contract BasicHomeBridge is EternalStorage, Validatable, Ownable, OwnedUpgradeab
}
function getFee() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("fee"))];
uint256 fee;
bytes memory callData = abi.encodeWithSignature("getFee()");
address feeManager = feeManagerContract();
assembly {
let result := delegatecall(gas, feeManager, add(callData, 0x20), mload(callData), 0, 32)
fee := mload(0)
switch result
case 0 { revert(0, 0) }
}
return fee;
}
function isContract(address _addr) internal view returns (bool)