mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
added setIdFee
This commit is contained in:
parent
556e920ee8
commit
52b7e1be41
|
@ -60,8 +60,7 @@ contract FeeResolver is Setup {
|
||||||
/**
|
/**
|
||||||
* @dev Calculate fee
|
* @dev Calculate fee
|
||||||
*/
|
*/
|
||||||
function calculateFee(uint amount, uint fee, uint getId, uint setId) external payable {
|
function calculateFee(uint amount, uint fee, uint getId, uint setId, uint setIdFee) external payable {
|
||||||
require(fee <= 5 * 10 ** 16, "Fee-more-than-5%"); // TODO: change
|
|
||||||
uint _amt = getUint(getId, amount);
|
uint _amt = getUint(getId, amount);
|
||||||
|
|
||||||
uint feeAmt = wmul(_amt, fee);
|
uint feeAmt = wmul(_amt, fee);
|
||||||
|
@ -69,6 +68,7 @@ contract FeeResolver is Setup {
|
||||||
uint totalAmt = add(_amt, feeAmt);
|
uint totalAmt = add(_amt, feeAmt);
|
||||||
|
|
||||||
setUint(setId, totalAmt);
|
setUint(setId, totalAmt);
|
||||||
|
setUint(setIdFee, feeAmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user