Skip to content

Commit cb48a5d

Browse files
committed
Add token parameter to event feeDistributed in kyberFeeHandler (KyberNetwork#1003)
* As part of infrastructure work to enable kyberFeeHandler to work with multiple fee tokens, add token parameter to event feeDistributed in kyberFeeHandler
1 parent 090c230 commit cb48a5d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Public facing interfaces for kyber network (folder: contracts/sol6):
1515
2. `npm ci`
1616

1717
## Compilation with Buidler
18-
1. `./cmp.sh` to compile contracts for all solidity verseions.
18+
1. `./cmp.sh` to compile contracts for all solidity versions.
1919
2. `./cmpSol6.sh` to compile only sol6 contracts
2020

2121
## Testing with Buidler
22-
1. If contracts have not been compiled, run `./compilation.sh`. This step can be skipped subsequently.
22+
1. If contracts have not been compiled, run `./cmp.sh`. This step can be skipped subsequently.
2323
2. Run `./tst.sh`
2424
3. Use `-f` for running a specific test file.
2525
5. Use `-a` to run tests for all solidity versions. Runs only sol6 tests by default.
@@ -37,4 +37,4 @@ Public facing interfaces for kyber network (folder: contracts/sol6):
3737
2. Use `-f` for running a specific test file.
3838

3939
### Example Commands
40-
`./coverage.sh -f ./test/sol6/kyberNetwork.js` (Coverage for only kyberNetwork.js)
40+
`./coverage.sh -f ./test/sol6/kyberNetwork.js` (Coverage for only kyberNetwork.js)

contracts/sol6/Dao/KyberFeeHandler.sol

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ contract KyberFeeHandler is IKyberFeeHandler, Utils5, DaoOperator, ReentrancyGua
9292
ISanityRate[] internal sanityRateContract;
9393

9494
event FeeDistributed(
95+
IERC20 indexed token,
9596
address indexed platformWallet,
9697
uint256 platformFeeWei,
9798
uint256 rewardWei,
@@ -186,6 +187,7 @@ contract KyberFeeHandler is IKyberFeeHandler, Utils5, DaoOperator, ReentrancyGua
186187
// only platform fee paid
187188
totalPayoutBalance = totalPayoutBalance.add(platformFee);
188189
emit FeeDistributed(
190+
ETH_TOKEN_ADDRESS,
189191
platformWallet,
190192
platformFee,
191193
0,
@@ -212,6 +214,7 @@ contract KyberFeeHandler is IKyberFeeHandler, Utils5, DaoOperator, ReentrancyGua
212214

213215
brrAmounts.burnWei = networkFee.sub(brrAmounts.rewardWei).sub(brrAmounts.rebateWei);
214216
emit FeeDistributed(
217+
ETH_TOKEN_ADDRESS,
215218
platformWallet,
216219
platformFee,
217220
brrAmounts.rewardWei,
@@ -265,7 +268,7 @@ contract KyberFeeHandler is IKyberFeeHandler, Utils5, DaoOperator, ReentrancyGua
265268
emit RewardPaid(staker, epoch, ETH_TOKEN_ADDRESS, amountWei);
266269
}
267270

268-
/// @dev claim reabate per reserve wallet. called by any address
271+
/// @dev claim rebate per reserve wallet. called by any address
269272
/// @param rebateWallet the wallet to claim rebates for. Total accumulated rebate sent to this wallet.
270273
/// @return amountWei amount of rebate claimed
271274
function claimReserveRebate(address rebateWallet)

test/sol6/kyberFeeHandler.js

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ contract('KyberFeeHandler', function(accounts) {
102102
let platformWallet = accounts[1];
103103
let txResult = await feeHandler.handleFees(ethAddress, [], [], platformWallet, oneEth, zeroBN, {from: kyberNetwork, value: oneEth});
104104
expectEvent(txResult, 'FeeDistributed', {
105+
token: ethAddress,
105106
platformWallet: platformWallet,
106107
platformFeeWei: oneEth,
107108
rewardWei: zeroBN,
@@ -129,6 +130,7 @@ contract('KyberFeeHandler', function(accounts) {
129130
let expectedRebateWei = oneEth.mul(currentRebateBps).div(BPS);
130131

131132
expectEvent(txResult, 'FeeDistributed', {
133+
token: ethAddress,
132134
platformWallet: platformWallet,
133135
platformFeeWei: oneEth,
134136
rewardWei: expectedRewardWei,

0 commit comments

Comments
 (0)