Fix fee related methods
This commit is contained in:
parent
9ee9ce4a61
commit
e752e94ec1
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue