-
Notifications
You must be signed in to change notification settings - Fork 229
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
Add Fee Manager for erc-to-native
bridge in POSDAO chain
#164
Conversation
deploy/README.md
Outdated
@@ -351,6 +351,8 @@ VALIDATORS=0x 0x 0x | |||
HOME_REWARDABLE=false | |||
# The flag defining whether to use RewardableValidators contract and set a fee manager contract on Foreign network | |||
FOREIGN_REWARDABLE=false | |||
# Flag to define if Home network is a POSDAO and rewards are distributed by blockReward contract | |||
HOME_POSDAO=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider to have the parameter like HOME_FEE_MANAGER_TYPE
and the value of this parameter will specify which fee manager should be deployed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for suggestion. Added here a448e3d Please check if possible values makes sense to you
setTotalBurntCoins(totalBurntCoins().add(valueToTransfer)); | ||
address(0).transfer(valueToTransfer); | ||
uint256 valueToBurn = valueToTransfer; | ||
if(isPOSDAOFeeManager()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this method should be called only in case if the fee manager is configured. So, could you consider the following changes:
- introduce the new method in the POSDAO fee manager:
getAmountToBurn
. This will allow to locate all logic related to fee handling in the fee manager. - change the fall back method in the bridge contract as following:
// . . .
// . . .
uint256 valueToTransfer = msg.value;
uint256 valueToBurn = valueToTransfer;
address feeManager = feeManagerContract();
if (feeManager != address(0)) {
valueToBurn = getAmountToBurn(valueToTransfer)
uint256 fee = calculateFee(valueToTransfer, false, feeManager, HOME_FEE);
valueToTransfer = valueToTransfer.sub(fee);
}
setTotalBurntCoins(totalBurntCoins().add(valueToBurn));
address(0).transfer(valueToBurn);
emit UserRequestForSignature(msg.sender, valueToTransfer);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions. Please check e605559
contracts/upgradeable_contracts/erc20_to_native/FeeManagerErcToNative.sol
Outdated
Show resolved
Hide resolved
…rc-native-posdao-chain # Conflicts: # contracts/IBlockReward.sol # contracts/test/BlockReward.sol # deploy/.env.example
contracts/upgradeable_contracts/erc20_to_native/FeeManagerErcToNativePOSDAO.sol
Show resolved
Hide resolved
We need to address the merge conflicts |
…rc-native-posdao-chain # Conflicts: # deploy/.env.example # deploy/src/erc_to_native/home.js # deploy/src/loadEnv.js
Merge conflicts fixed |
Closes #159