Skip to content

Commit 153594a

Browse files
Update deploy script (#158)
* implemented trading rewards inflation diversion * make visibility explicit * πŸ”¨ Update Deploy Script * Use Owned instead of Ownable (rest of project uses Owned) * βœ… Update tests * Update Deploy Script & Remove Unused Code * πŸ—‘ Remove Libraries Co-authored-by: JChiaramonte7 <[email protected]>
1 parent 60a4b07 commit 153594a

23 files changed

+131
-778
lines changed

β€Ž.solhint.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"not-rely-on-time": "off",
55
"reason-string": "off",
66
"max-states-count": "off",
7+
"contract-name-camelcase": "off",
78
"compiler-version": [
89
"error",
910
"^0.8.0"

β€ŽREADME.md

-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ Any escrowed Kwenta can also be staked back into StakingRewards, boosting potent
4848

4949
Another new feature introduced here is a linearly decaying vesting fee that allows beneficiaries to vest early – at a cost. Immediate vesting is subject to a fee that is 80% of the escrowed amount. It falls to 0% as the reward reaches the end of the escrow duration. The fee is burned.
5050

51-
### ExchangerProxy.sol
52-
53-
A simple contract that forwards trades to the Synthetix Exchanger, but updates each person’s trader score (currently measured as fees paid), and subsequently `rewardScore` in StakingRewards.
54-
5551
## Testing
5652

5753
```

β€Žcontracts/ControlL2MerkleDistributor.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ contract ControlL2MerkleDistributor is IControlL2MerkleDistributor {
1212
/// @notice communication between L1 and L2 is enabled by two special
1313
/// smart contracts called the "messengers"
1414
/// and below is the address for the messenger on L1
15-
address immutable crossDomainMessengerAddr;
15+
address internal immutable crossDomainMessengerAddr;
1616

1717
/// @notice MerkleDistributor deployed on L2
18-
address immutable merkleDistributorL2Address;
18+
address internal immutable merkleDistributorL2Address;
1919

2020
/// @notice set addresses for deployed MerkleDistributor on L2 and
2121
/// OE cross domain messenger address on L1

β€Žcontracts/MultipleMerkleDistributor.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contract MultipleMerkleDistributor is IMultipleMerkleDistributor, Owned {
1818
address public immutable override token;
1919

2020
/// @notice an index that is incremented for each new merkle root
21-
uint256 distributionEpoch;
21+
uint256 public distributionEpoch;
2222

2323
/// @notice an epoch to merkle root mapping
2424
/// of a merkle tree containing account balances available to claim

β€Žcontracts/StakingRewards.sol

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
44
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
55
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
66
import "@openzeppelin/contracts/security/Pausable.sol";
7-
import "@openzeppelin/contracts/access/Ownable.sol";
7+
import "./utils/Owned.sol";
88
import "./interfaces/IStakingRewards.sol";
99
import "./interfaces/ISupplySchedule.sol";
1010
import "./interfaces/IRewardEscrow.sol";
@@ -13,7 +13,7 @@ import "./interfaces/IRewardEscrow.sol";
1313
/// @author SYNTHETIX, JaredBorders ([email protected]), JChiaramonte7 ([email protected])
1414
/// @notice Updated version of Synthetix's StakingRewards with new features specific
1515
/// to Kwenta
16-
contract StakingRewards is IStakingRewards, Ownable, ReentrancyGuard, Pausable {
16+
contract StakingRewards is IStakingRewards, Owned, ReentrancyGuard, Pausable {
1717
using SafeERC20 for IERC20;
1818

1919
/*///////////////////////////////////////////////////////////////
@@ -143,7 +143,7 @@ contract StakingRewards is IStakingRewards, Ownable, ReentrancyGuard, Pausable {
143143
address _token,
144144
address _rewardEscrow,
145145
address _supplySchedule
146-
) {
146+
) Owned(msg.sender) {
147147
// define reward/staking token
148148
token = IERC20(_token);
149149

@@ -464,7 +464,7 @@ contract StakingRewards is IStakingRewards, Ownable, ReentrancyGuard, Pausable {
464464
tokenAddress != address(token),
465465
"StakingRewards: Cannot unstake the staking token"
466466
);
467-
IERC20(tokenAddress).safeTransfer(owner(), tokenAmount);
467+
IERC20(tokenAddress).safeTransfer(owner, tokenAmount);
468468
emit Recovered(tokenAddress, tokenAmount);
469469
}
470470
}

β€Žcontracts/interfaces/IAddressResolver.sol

-10
This file was deleted.

β€Žcontracts/interfaces/IDelegateApprovals.sol

-11
This file was deleted.

β€Žcontracts/interfaces/IExchangeRates.sol

-16
This file was deleted.

β€Žcontracts/interfaces/IExchanger.sol

-77
This file was deleted.

β€Žcontracts/interfaces/ISynth.sol

-23
This file was deleted.

β€Žcontracts/interfaces/IVirtualSynth.sol

-21
This file was deleted.

β€Žcontracts/libraries/ExponentLib.sol

-44
This file was deleted.

β€Žcontracts/libraries/FixidityLib.sol

-88
This file was deleted.

0 commit comments

Comments
Β (0)