Skip to content

Commit

Permalink
Update StETHMock and WStETHMock contracts, and config files
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanProgrammer committed Jan 10, 2024
1 parent c180944 commit ff6af67
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
17 changes: 10 additions & 7 deletions contracts/mock/tokens/StETHMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@ pragma solidity ^0.8.20;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {PRECISION} from "@solarity/solidity-lib/utils/Globals.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract StETHMock is ERC20 {
uint256 public totalPooledEther = PRECISION;
contract StETHMock is ERC20, Ownable {
uint256 public balanceMultiplicator = PRECISION;

constructor() ERC20("Staked Ether", "stETH") {}
constructor() ERC20("Staked Ether Mock", "stETHMock") {}

function mint(address account_, uint256 amount_) external {
require(amount_ <= 10 * (10 ** decimals()), "StETHMock: amount is too big");

_mint(account_, amount_);
}

function _transfer(address sender_, address recipient_, uint256 amount_) internal override {
amount_ = (amount_ * PRECISION) / totalPooledEther;
amount_ = (amount_ * PRECISION) / balanceMultiplicator;
super._transfer(sender_, recipient_, amount_);
}

function setTotalPooledEther(uint256 totalPooledEther_) external {
totalPooledEther = totalPooledEther_;
function setBalanceMultiplicator(uint256 balanceMultiplicator_) external onlyOwner {
balanceMultiplicator = balanceMultiplicator_;
}

function balanceOf(address account_) public view override returns (uint256) {
return (super.balanceOf(account_) * totalPooledEther) / PRECISION;
return (super.balanceOf(account_) * balanceMultiplicator) / PRECISION;
}
}
2 changes: 1 addition & 1 deletion contracts/mock/tokens/WStETHMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {IStETH} from "../../interfaces/tokens/IStETH.sol";
contract WStETHMock is ERC20 {
IStETH public stETH;

constructor(address stETH_) ERC20("Wraped Staked Ether", "WStETH") {
constructor(address stETH_) ERC20("Wraped Staked Ether Mock", "WStETHMock") {
stETH = IStETH(stETH_);
}

Expand Down
1 change: 1 addition & 0 deletions deploy/data/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"decreaseInterval": 86400,
"withdrawLockPeriod": 120,
"claimLockPeriod": 60,
"withdrawLockPeriodAfterStake": 30,
"initialReward": "14400000000000000000000",
"rewardDecrease": "2468994701000000000",
"minimalStake": "1000000000000000",
Expand Down
1 change: 1 addition & 0 deletions deploy/data/config_goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"decreaseInterval": 86400,
"withdrawLockPeriod": 120,
"claimLockPeriod": 60,
"withdrawLockPeriodAfterStake": 30,
"initialReward": "14400000000000000000000",
"rewardDecrease": "2468994701000000000",
"minimalStake": "1000000000000000",
Expand Down
1 change: 1 addition & 0 deletions deploy/data/config_localhost.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"decreaseInterval": 86400,
"withdrawLockPeriod": 120,
"claimLockPeriod": 60,
"withdrawLockPeriodAfterStake": 30,
"initialReward": "14400000000000000000000",
"rewardDecrease": "2468994701000000000",
"minimalStake": "1000000000000000",
Expand Down
3 changes: 2 additions & 1 deletion deploy/data/config_sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"decreaseInterval": 86400,
"withdrawLockPeriod": 120,
"claimLockPeriod": 60,
"withdrawLockPeriodAfterStake": 30,
"initialReward": "14400000000000000000000",
"rewardDecrease": "2468994701000000000",
"minimalStake": "10000000000",
Expand Down Expand Up @@ -38,7 +39,7 @@
"L2": {
"swapRouter": "0xE592427A0AEce92De3Edee1F18E0157C05861564",
"nonfungiblePositionManager": "0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
"wStEth": "0xed2f149221ECf2Cf4e929560B8E42a94555c3986"
"wStEth": "0xfD5d8Dc9918e04673b9F5F332cE63BcC3BE427a2"
},
"swapParams": {
"fee": 10000,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"private-network-fork": "npx hardhat node --fork https://mainnet.infura.io/v3/$(grep INFURA_KEY .env | cut -d '\"' -f2)",
"deploy-localhost": "npx hardhat migrate --network localhost",
"deploy-goerli": "npx hardhat migrate --network goerli --verify",
"deploy-sepolia": "npx hardhat migrate --network sepolia --verify --continue",
"deploy-sepolia": "npx hardhat migrate --network sepolia --verify",
"deploy-chapel": "npx hardhat migrate --network chapel --verify",
"deploy-mumbai": "npx hardhat migrate --network mumbai --verify",
"deploy-fuji": "npx hardhat migrate --network fuji --verify",
Expand Down

0 comments on commit ff6af67

Please sign in to comment.