Fix fee related methods

This commit is contained in:
Gerardo Nardelli 2019-01-10 15:59:24 -03:00
parent 9ee9ce4a61
commit e752e94ec1
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ contract BaseFeeManager is EternalStorage {
event FeeUpdated(uint256 fee);
function calculateFee(uint256 _value, bool _recover) external view returns(uint256) {
function calculateFee(uint256 _value, bool _recover) external payable returns(uint256) {
uint256 fee = getFee();
uint256 eth = 1 ether;
if (!_recover) {

View File

@ -92,7 +92,7 @@ contract BasicHomeBridge is EternalStorage, Validatable, Ownable, OwnedUpgradeab
address contractAddress;
(recipient, amount, txHash, contractAddress) = Message.parseMessage(message);
uint256 fee = calculateFee(amount, true, feeManager);
feeManager.delegatecall(abi.encodeWithSignature("distributeFeeFromSignatures(uint256)", fee));
require(feeManager.delegatecall(abi.encodeWithSignature("distributeFeeFromSignatures(uint256)", fee)));
}
function setMessagesSigned(bytes32 _hash, bool _status) internal {

View File

@ -95,7 +95,7 @@ contract HomeBridgeErcToNative is EternalStorage, BasicBridge, BasicHomeBridge,
address feeManager = feeManagerContract();
if (feeManager != address(0)) {
uint256 fee = calculateFee(valueToMint, false, feeManager);
feeManager.delegatecall(abi.encodeWithSignature("distributeFeeFromAffirmation(uint256)", fee));
require(feeManager.delegatecall(abi.encodeWithSignature("distributeFeeFromAffirmation(uint256)", fee)));
valueToMint = valueToMint.sub(fee);
}
blockReward.addExtraReceiver(valueToMint, _recipient);