Skip to content

Commit 5407e50

Browse files
committed
✨ prettify
1 parent 0a73b0d commit 5407e50

34 files changed

+446
-657
lines changed

contracts/EscrowDistributor.sol

+3-12
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ contract EscrowDistributor {
1212
/// @notice kwenta token contract
1313
IERC20 public immutable kwenta;
1414

15-
event BatchEscrowed(
16-
uint256 totalAccounts,
17-
uint256 totalTokens,
18-
uint256 durationWeeks
19-
);
15+
event BatchEscrowed(uint256 totalAccounts, uint256 totalTokens, uint256 durationWeeks);
2016

2117
constructor(address kwentaAddr, address rewardEscrowAddr) {
2218
kwenta = IERC20(kwentaAddr);
@@ -36,8 +32,7 @@ contract EscrowDistributor {
3632
uint256 durationWeeks
3733
) external {
3834
require(
39-
accounts.length == amounts.length,
40-
"Number of accounts does not match number of values"
35+
accounts.length == amounts.length, "Number of accounts does not match number of values"
4136
);
4237

4338
uint256 length = accounts.length;
@@ -60,11 +55,7 @@ contract EscrowDistributor {
6055
unchecked {
6156
--length;
6257
}
63-
rewardEscrow.createEscrowEntry(
64-
accounts[length],
65-
amounts[length],
66-
duration
67-
);
58+
rewardEscrow.createEscrowEntry(accounts[length], amounts[length], duration);
6859
} while (length != 0);
6960

7061
emit BatchEscrowed({

contracts/EscrowedMultipleMerkleDistributor.sol

+7-22
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import "./interfaces/IEscrowedMultipleMerkleDistributor.sol";
1010
/// @title Kwenta EscrowedMultipleMerkleDistributor
1111
/// @author JaredBorders and JChiaramonte7
1212
/// @notice Facilitates trading incentives distribution over multiple periods.
13-
contract EscrowedMultipleMerkleDistributor is
14-
IEscrowedMultipleMerkleDistributor,
15-
Owned
16-
{
13+
contract EscrowedMultipleMerkleDistributor is IEscrowedMultipleMerkleDistributor, Owned {
1714
/// @inheritdoc IEscrowedMultipleMerkleDistributor
1815
address public immutable override rewardEscrow;
1916

@@ -31,29 +28,19 @@ contract EscrowedMultipleMerkleDistributor is
3128
/// @param _owner: designated owner of this contract
3229
/// @param _token: address of erc20 token to be distributed
3330
/// @param _rewardEscrow: address of kwenta escrow for tokens claimed
34-
constructor(
35-
address _owner,
36-
address _token,
37-
address _rewardEscrow
38-
) Owned(_owner) {
31+
constructor(address _owner, address _token, address _rewardEscrow) Owned(_owner) {
3932
token = _token;
4033
rewardEscrow = _rewardEscrow;
4134
}
4235

4336
/// @inheritdoc IEscrowedMultipleMerkleDistributor
44-
function setMerkleRootForEpoch(
45-
bytes32 merkleRoot,
46-
uint256 epoch
47-
) external override onlyOwner {
37+
function setMerkleRootForEpoch(bytes32 merkleRoot, uint256 epoch) external override onlyOwner {
4838
merkleRoots[epoch] = merkleRoot;
4939
emit MerkleRootModified(epoch);
5040
}
5141

5242
/// @inheritdoc IEscrowedMultipleMerkleDistributor
53-
function isClaimed(
54-
uint256 index,
55-
uint256 epoch
56-
) public view override returns (bool) {
43+
function isClaimed(uint256 index, uint256 epoch) public view override returns (bool) {
5744
uint256 claimedWordIndex = index / 256;
5845
uint256 claimedBitIndex = index % 256;
5946
uint256 claimedWord = claimedBitMaps[epoch][claimedWordIndex];
@@ -68,8 +55,7 @@ contract EscrowedMultipleMerkleDistributor is
6855
uint256 claimedWordIndex = index / 256;
6956
uint256 claimedBitIndex = index % 256;
7057
claimedBitMaps[epoch][claimedWordIndex] =
71-
claimedBitMaps[epoch][claimedWordIndex] |
72-
(1 << claimedBitIndex);
58+
claimedBitMaps[epoch][claimedWordIndex] | (1 << claimedBitIndex);
7359
}
7460

7561
/// @inheritdoc IEscrowedMultipleMerkleDistributor
@@ -81,8 +67,7 @@ contract EscrowedMultipleMerkleDistributor is
8167
uint256 epoch
8268
) public override {
8369
require(
84-
!isClaimed(index, epoch),
85-
"EscrowedMultipleMerkleDistributor: Drop already claimed."
70+
!isClaimed(index, epoch), "EscrowedMultipleMerkleDistributor: Drop already claimed."
8671
);
8772

8873
// verify the merkle proof
@@ -108,7 +93,7 @@ contract EscrowedMultipleMerkleDistributor is
10893
/// @inheritdoc IEscrowedMultipleMerkleDistributor
10994
function claimMultiple(Claims[] calldata claims) external override {
11095
uint256 cacheLength = claims.length;
111-
for (uint256 i = 0; i < cacheLength; ) {
96+
for (uint256 i = 0; i < cacheLength;) {
11297
claim(
11398
claims[i].index,
11499
claims[i].account,

contracts/Kwenta.sol

+2-10
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,15 @@ contract Kwenta is ERC20, Owned, IKwenta {
3131
}
3232

3333
// Mints inflationary supply
34-
function mint(address account, uint256 amount)
35-
external
36-
override
37-
onlySupplySchedule
38-
{
34+
function mint(address account, uint256 amount) external override onlySupplySchedule {
3935
_mint(account, amount);
4036
}
4137

4238
function burn(uint256 amount) external override {
4339
_burn(msg.sender, amount);
4440
}
4541

46-
function setSupplySchedule(address _supplySchedule)
47-
external
48-
override
49-
onlyOwner
50-
{
42+
function setSupplySchedule(address _supplySchedule) external override onlyOwner {
5143
require(_supplySchedule != address(0), "Kwenta: Invalid Address");
5244
supplySchedule = ISupplySchedule(_supplySchedule);
5345
}

contracts/MultipleMerkleDistributor.sol

+6-18
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import "./interfaces/IMultipleMerkleDistributor.sol";
1414
contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
1515
using SafeERC20 for IERC20;
1616
/// @inheritdoc IMultipleMerkleDistributor
17+
1718
address public immutable override token;
1819

1920
/// @inheritdoc IMultipleMerkleDistributor
@@ -31,22 +32,13 @@ contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
3132
}
3233

3334
/// @inheritdoc IMultipleMerkleDistributor
34-
function setMerkleRootForEpoch(bytes32 merkleRoot, uint256 epoch)
35-
external
36-
override
37-
onlyOwner
38-
{
35+
function setMerkleRootForEpoch(bytes32 merkleRoot, uint256 epoch) external override onlyOwner {
3936
merkleRoots[epoch] = merkleRoot;
4037
emit MerkleRootModified(epoch);
4138
}
4239

4340
/// @inheritdoc IMultipleMerkleDistributor
44-
function isClaimed(uint256 index, uint256 epoch)
45-
public
46-
view
47-
override
48-
returns (bool)
49-
{
41+
function isClaimed(uint256 index, uint256 epoch) public view override returns (bool) {
5042
uint256 claimedWordIndex = index / 256;
5143
uint256 claimedBitIndex = index % 256;
5244
uint256 claimedWord = claimedBitMaps[epoch][claimedWordIndex];
@@ -61,8 +53,7 @@ contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
6153
uint256 claimedWordIndex = index / 256;
6254
uint256 claimedBitIndex = index % 256;
6355
claimedBitMaps[epoch][claimedWordIndex] =
64-
claimedBitMaps[epoch][claimedWordIndex] |
65-
(1 << claimedBitIndex);
56+
claimedBitMaps[epoch][claimedWordIndex] | (1 << claimedBitIndex);
6657
}
6758

6859
/// @inheritdoc IMultipleMerkleDistributor
@@ -73,10 +64,7 @@ contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
7364
bytes32[] calldata merkleProof,
7465
uint256 epoch
7566
) public override {
76-
require(
77-
!isClaimed(index, epoch),
78-
"MultipleMerkleDistributor: Drop already claimed."
79-
);
67+
require(!isClaimed(index, epoch), "MultipleMerkleDistributor: Drop already claimed.");
8068

8169
// verify the merkle proof
8270
bytes32 node = keccak256(abi.encodePacked(index, account, amount));
@@ -95,7 +83,7 @@ contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
9583
/// @inheritdoc IMultipleMerkleDistributor
9684
function claimMultiple(Claims[] calldata claims) external override {
9785
uint256 cacheLength = claims.length;
98-
for (uint256 i = 0; i < cacheLength; ) {
86+
for (uint256 i = 0; i < cacheLength;) {
9987
claim(
10088
claims[i].index,
10189
claims[i].account,

0 commit comments

Comments
 (0)