Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contracts/tokens/EsToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ contract EsToken is RestrictedToken, IEsToken {

constructor(string memory _name, string memory _symbol, address _claimableToken) RestrictedToken(_name, _symbol,
TokenType.ESCROW) {
require(_claimableToken != address(0), "ZERO_ADDRESS");
claimableToken = _claimableToken;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gammaswap/v1-staking",
"version": "0.10.8",
"version": "0.10.9",
"description": "Staking contracts for GammaSwapV1 protocol",
"scripts": {
"hardhat": "hardhat",
Expand Down
9 changes: 9 additions & 0 deletions test/foundry/StakingRouter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "@gammaswap/v1-core/contracts/base/GammaPoolERC20.sol";

import "../../contracts/interfaces/IRewardTracker.sol";
import "./fixtures/CPMMGammaSwapSetup.sol";
import "../../contracts/tokens/EsToken.sol";

contract StakingRouterTest is CPMMGammaSwapSetup {
function setUp() public {
Expand All @@ -27,6 +28,14 @@ contract StakingRouterTest is CPMMGammaSwapSetup {
approveUserForStaking(user2, address(pool2));
}

function testEscrowToken() public {
EsToken esToken = new EsToken("test token", "TOK1", address(0x123));
assertEq(esToken.claimableToken(), address(0x123));

vm.expectRevert("ZERO_ADDRESS");
EsToken esTokenTest = new EsToken("test token", "TOK1", address(0));
}

function testStakingContractsAlreadySet() public {
vm.expectRevert(bytes4(keccak256("GSTokensAlreadySet()")));
stakingRouter.initializeGSTokens(address(gs), address(esGs), address(esGsb), address(bnGs), address(weth));
Expand Down