Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fee Manager for erc-to-native bridge in POSDAO chain #164

Merged
7 changes: 2 additions & 5 deletions contracts/upgradeable_contracts/BlockRewardFeeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ contract BlockRewardFeeManager is BaseFeeManager {
distributeFeeFromBlockReward(_fee);
}

function distributeFeeFromBlockReward(uint256 _fee) internal {
IBlockReward blockReward = _blockRewardContract();
blockReward.addBridgeTokenFeeReceivers(_fee);
}

function _blockRewardContract() internal view returns(IBlockReward) {
return IBlockReward(addressStorage[keccak256(abi.encodePacked("blockRewardContract"))]);
}

function distributeFeeFromBlockReward(uint256 _fee) internal;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ contract FeeManagerErcToErcPOSDAO is BlockRewardFeeManager {
addressStorage[keccak256(abi.encodePacked("blockRewardContract"))] = _blockReward;
}

function distributeFeeFromBlockReward(uint256 _fee) internal {
IBlockReward blockReward = _blockRewardContract();
blockReward.addBridgeTokenFeeReceivers(_fee);
}

function isContract(address _addr) internal view returns (bool)
{
uint length;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
pragma solidity 0.4.24;

import "../BaseFeeManager.sol";
import "../../IBlockReward.sol";
import "../BlockRewardFeeManager.sol";

contract FeeManagerErcToNativePOSDAO is BaseFeeManager {
contract FeeManagerErcToNativePOSDAO is BlockRewardFeeManager {

function getFeeManagerMode() public pure returns(bytes4) {
return bytes4(keccak256(abi.encodePacked("manages-both-directions")));
}

function blockRewardContract() internal view returns(IBlockReward) {
return IBlockReward(addressStorage[keccak256(abi.encodePacked("blockRewardContract"))]);
}

function distributeFeeFromAffirmation(uint256 _fee) external {
distributeFeeFromBlockReward(_fee);
}

function distributeFeeFromSignatures(uint256 _fee) external {
distributeFeeFromBlockReward(_fee);
}

function distributeFeeFromBlockReward(uint256 _fee) internal {
IBlockReward blockReward = blockRewardContract();
IBlockReward blockReward = _blockRewardContract();
blockReward.addBridgeNativeFeeReceivers(_fee);
}

function getAmountToBurn(uint256 _value) public view returns(uint256) {
return _value;
}

function onAffirmationFeeDistribution(address _rewardAddress, uint256 _fee) internal {}

function onSignatureFeeDistribution(address _rewardAddress, uint256 _fee) internal {}
}