Skip to content

Commit

Permalink
Merge pull request #11 from chimera-defi/fix/build
Browse files Browse the repository at this point in the history
Fix/build
  • Loading branch information
chimera-defi authored May 27, 2024
2 parents c414917 + 45060df commit ae40f84
Show file tree
Hide file tree
Showing 8 changed files with 9,790 additions and 6,197 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ artifacts
secrets.js
deploy_log.json
logs.txt

.env
109 changes: 1 addition & 108 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,120 +13,13 @@ V2 core auditable contracts and guidance/README in `contracts/v2/core`.

See deploy_log.md for new deployed contract addresses

## Jul 19 2023

SharedDeposit mainnet RC1 deployed.
Feat. minting Eth liquid staking derivative, rollovers to v2 from v1, withdrawals

SgETH deployed to 0x9e52dB44d62A8c9762FA847Bd2eBa9d0585782d1 at
https://etherscan.io/address/0x9e52dB44d62A8c9762FA847Bd2eBa9d0585782d1

WSGETH deployed to 0x31AA035313b1D2109e61Ee0E3662A86A8615fF1d at
https://etherscan.io/address/0x31AA035313b1D2109e61Ee0E3662A86A8615fF1d

SharedDepositMinterV2 deployed to 0x85Bc06f4e3439d41f610a440Ba0FbE333736B310 at
https://etherscan.io/address/0x85Bc06f4e3439d41f610a440Ba0FbE333736B310

PaymentSplitter deployed to 0x11017593C9BfD1E173ac0c59E2fCca260b10d467 at
https://etherscan.io/address/0x11017593C9BfD1E173ac0c59E2fCca260b10d467

Withdrawals deployed to 0xB4AAd1Fe1AD6153525bAf687e1f200183a030E30 at
https://etherscan.io/address/0xB4AAd1Fe1AD6153525bAf687e1f200183a030E30

RewardsReceiver deployed to 0x4B9BF4DcA2fbF2C6D5266d51254638820243bFaD at
https://etherscan.io/address/0x4B9BF4DcA2fbF2C6D5266d51254638820243bFaD

WithdrawalsvETH2 deployed to 0xed4e21BD620F3C1Fd1853b1C52A9D023C33D83d4 at
https://etherscan.io/address/0xed4e21BD620F3C1Fd1853b1C52A9D023C33D83d4

Rollover deployed to 0x68a31dfD0c81A411C5adadc8A40225425777466C at
https://etherscan.io/address/0x68a31dfD0c81A411C5adadc8A40225425777466C

## Aug 31 '21

NFT
MintableNFTSale deployed to 0x926a65012C23dcfB2227af46e6135C1c6413D8Ac at https://etherscan.io/address/0x926a65012C23dcfB2227af46e6135C1c6413D8Ac
cost: 322125589811035895 or 0.322 ETH

founderVesting deployed to 0x0279eBC54179EBc5E5e65A9f036Db351233adDc6 at https://etherscan.io/address/0x0279eBC54179EBc5E5e65A9f036Db351233adDc6
treasuryVesting deployed to 0x2Cb4bdc030975f2ABdbbb984e87715505C51D5BC at https://etherscan.io/address/0x2Cb4bdc030975f2ABdbbb984e87715505C51D5BC
SGTv2 deployed to 0x24C19F7101c1731b85F1127EaA0407732E36EcDD at https://etherscan.io/address/0x24C19F7101c1731b85F1127EaA0407732E36EcDD

TokenMigrator deployed to 0x9615460582Efa2a9b1d8D21e7E02afE43A415E13 at https://etherscan.io/address/0x9615460582Efa2a9b1d8D21e7E02afE43A415E13
VoteEscrowFactory deployed to 0xeE5bd4b9C875BE3958b1255D181B8B3E978903b9 at https://etherscan.io/address/0xeE5bd4b9C875BE3958b1255D181B8B3E978903b9
SimpleTimelock deployed to 0xC0AAB794F9D2aA7cE56B8BEB6cFfc71BC05c21FC at https://etherscan.io/address/0xC0AAB794F9D2aA7cE56B8BEB6cFfc71BC05c21FC
FundDistributor deployed to 0x38aa4CC003D9Ad84505bc7b096122402Db31f708 at https://etherscan.io/address/0x38aa4CC003D9Ad84505bc7b096122402Db31f708
MasterChef deployed to 0x84B7644095d9a8BFDD2e5bfD8e41740bc1f4f412 at https://etherscan.io/address/0x84B7644095d9a8BFDD2e5bfD8e41740bc1f4f412

VeSGT : 0x21b555305e9d65c8b8ae232e60fd806edc9c5d78 : https://etherscan.io/address/0x21b555305e9d65c8b8ae232e60fd806edc9c5d78#code

# Goerli

## Fri jul 7 23

SharedDepositMinterV2 deployed to 0x1C974Ef3993152eCB53FdCF8b543b39f82122447 at https://goerli.etherscan.io/address/0x1C974Ef3993152eCB53FdCF8b543b39f82122447

PaymentSplitter deployed to 0xa609E0Dd2475739ac705fc17f38D9F5584c2c28D at https://goerli.etherscan.io/address/0xa609E0Dd2475739ac705fc17f38D9F5584c2c28D

Withdrawals deployed to 0x807EB95706E365115adAbeb4884c1Eb39D062A6d at https://goerli.etherscan.io/address/0x807EB95706E365115adAbeb4884c1Eb39D062A6d

RewardsReceiver deployed to 0x67c2F94F308F7fe6Dd1bf1bD7BF55715E1b1579b at https://goerli.etherscan.io/address/0x67c2F94F308F7fe6Dd1bf1bD7BF55715E1b1579b

## Wed jul 6 '23

SharedDepositMinterV2 deployed to 0x711c07cbfb82d5cB6Eb665350237C25c302f4A13 at https://goerli.etherscan.io/address/0x711c07cbfb82d5cB6Eb665350237C25c302f4A13

PaymentSplitter deployed to 0xA64629072cb064B2F3084Ca4C2D9d1e2F5c1fe02 at https://goerli.etherscan.io/address/0xA64629072cb064B2F3084Ca4C2D9d1e2F5c1fe02

Withdrawals deployed to 0x01cF4caDca14a9988F9116d7701494e58E567528 at https://goerli.etherscan.io/address/0x01cF4caDca14a9988F9116d7701494e58E567528

YieldDirector deployed to 0xc539a20b49DDe9a0E86b3FF5e00CCD5519001114 at https://goerli.etherscan.io/address/0xc539a20b49DDe9a0E86b3FF5e00CCD5519001114

RewardsReceiver deployed to 0x3048D0A5813dFcB7aD4Dbb2f747E993aF8b70E8a at https://goerli.etherscan.io/address/0x3048D0A5813dFcB7aD4Dbb2f747E993aF8b70E8a

## Wed jul 5 '23

SharedDepositMinterV2 deployed to 0x5d03e8d58A58244DB0ad5D4CEc7DC7737F2F37a3 at https://goerli.etherscan.io/address/0x5d03e8d58A58244DB0ad5D4CEc7DC7737F2F37a3

## Sun jul 2 '23

SharedDepositMinterV2 deployed to 0x5464Eb94ECf019d5b05099A89dB302cF7ac3e863 at https://goerli.etherscan.io/address/0x5464Eb94ECf019d5b05099A89dB302cF7ac3e863

## Wed Jun 14 '23

SgETH deployed to 0x453B459249F82ba3f369651aD485Fa11C6F082F8 at https://goerli.etherscan.io/address/0x453B459249F82ba3f369651aD485Fa11C6F082F8
WSGETH deployed to 0xbFA813C3266Af70A5Ddc15d9253655281e2bCd23 at https://goerli.etherscan.io/address/0xbFA813C3266Af70A5Ddc15d9253655281e2bCd23
SharedDepositMinter deployed to 0xb5ae9d51858436c23dca94370a38ff495a54873b at https://goerli.etherscan.io/address/0xb5ae9d51858436c23dca94370a38ff495a54873b
PaymentSplitter deployed to 0xC01063EC89B210BE8037d549D618980845657994 at https://goerli.etherscan.io/address/0xC01063EC89B210BE8037d549D618980845657994
Withdrawals deployed to 0x765d0dA8536cE858E0D2B54025b223231db0FeAE at https://goerli.etherscan.io/address/0x765d0dA8536cE858E0D2B54025b223231db0FeAE
ETH2SgETHYieldRedirector deployed to 0x8253F05c5E7b76F5ff855a6D52Ea9B9B5FD666cA at https://goerli.etherscan.io/address/0x8253F05c5E7b76F5ff855a6D52Ea9B9B5FD666cA
RewardsReceiver deployed to 0xC9F2ddBf105ff67c2BA30b2dB968Bc564a16ca67 at https://goerli.etherscan.io/address/0xC9F2ddBf105ff67c2BA30b2dB968Bc564a16ca67
WithdrawalsvETH2 deployed to 0xd70201Ea40c12cFE6Bf69Dc9A2ca9FB14bb8DB0b at https://goerli.etherscan.io/address/0xd70201Ea40c12cFE6Bf69Dc9A2ca9FB14bb8DB0b
Rollover deployed to 0xaa93EF92Ef8663902BeE679B9B8bFB60c966d50C at https://goerli.etherscan.io/address/0xaa93EF92Ef8663902BeE679B9B8bFB60c966d50C

## Wed Jun 7 '23

SgETH deployed to 0xd0f593aeB7E22B1038edC398aA53A56B38435de9 at https://goerli.etherscan.io/address/0xd0f593aeB7E22B1038edC398aA53A56B38435de9
WSGETH deployed to 0xCE066A0C47b95aA7fF53A22D099A1F33F3d7e7D9 at https://goerli.etherscan.io/address/0xCE066A0C47b95aA7fF53A22D099A1F33F3d7e7D9
SharedDepositMinter deployed to 0x62a4f18E1c42c63c6D02668A714eaD7323eF5CE0 at https://goerli.etherscan.io/address/0x62a4f18E1c42c63c6D02668A714eaD7323eF5CE0
PaymentSplitter deployed to 0xBaB96eEEE86b3dc57378C2b95aaFEc0aD3cc1Ed5 at https://goerli.etherscan.io/address/0xBaB96eEEE86b3dc57378C2b95aaFEc0aD3cc1Ed5
Withdrawals deployed to 0x62C4df1d2D30509833dEac78E968762Bf1B0CB6d at https://goerli.etherscan.io/address/0x62C4df1d2D30509833dEac78E968762Bf1B0CB6d
ETH2SgETHYieldRedirector deployed to 0xd810D44Ad63582C457814eD3a47e1d9B83aC2358 at https://goerli.etherscan.io/address/0xd810D44Ad63582C457814eD3a47e1d9B83aC2358
RewardsReceiver deployed to 0xf38bA1f9B416Ce6eB3D9336f417a5Fbf88aEb84F at https://goerli.etherscan.io/address/0xf38bA1f9B416Ce6eB3D9336f417a5Fbf88aEb84F
WithdrawalsvETH2 deployed to 0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a at https://goerli.etherscan.io/address/0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a
Rollover deployed to 0x17b9Ee3963a58c82d64Aa9fdaCce261257834623 at https://goerli.etherscan.io/address/0x17b9Ee3963a58c82d64Aa9fdaCce261257834623

May 24 '23
Goerli test of streamlined Withdrawals contract
/// @dev Test on goerli deployed at https://goerli.etherscan.io/address/0x4db116ad5cca33ba5d2956dba80d56f27b6b2455

# Quickstart and developer notes

- Following env best practices from https://github.com/paulrberg/solidity-template
- Pre-run checks:

```
npm i --force
yarn install
yarn sol
```

Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/VoteEscrowFactory.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.7;
import "./VoteEscrow.sol";
import "./voteEscrow.sol";
import "../interfaces/IVotingEscrow.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

Expand Down
107 changes: 107 additions & 0 deletions deploy_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,110 @@
Rollover: '0x8CcE3694d698cb5DF1e1bD8A948899449Ea94ffB'
}
```

## Jul 19 2023

SharedDeposit mainnet RC1 deployed.
Feat. minting Eth liquid staking derivative, rollovers to v2 from v1, withdrawals

SgETH deployed to 0x9e52dB44d62A8c9762FA847Bd2eBa9d0585782d1 at
https://etherscan.io/address/0x9e52dB44d62A8c9762FA847Bd2eBa9d0585782d1

WSGETH deployed to 0x31AA035313b1D2109e61Ee0E3662A86A8615fF1d at
https://etherscan.io/address/0x31AA035313b1D2109e61Ee0E3662A86A8615fF1d

SharedDepositMinterV2 deployed to 0x85Bc06f4e3439d41f610a440Ba0FbE333736B310 at
https://etherscan.io/address/0x85Bc06f4e3439d41f610a440Ba0FbE333736B310

PaymentSplitter deployed to 0x11017593C9BfD1E173ac0c59E2fCca260b10d467 at
https://etherscan.io/address/0x11017593C9BfD1E173ac0c59E2fCca260b10d467

Withdrawals deployed to 0xB4AAd1Fe1AD6153525bAf687e1f200183a030E30 at
https://etherscan.io/address/0xB4AAd1Fe1AD6153525bAf687e1f200183a030E30

RewardsReceiver deployed to 0x4B9BF4DcA2fbF2C6D5266d51254638820243bFaD at
https://etherscan.io/address/0x4B9BF4DcA2fbF2C6D5266d51254638820243bFaD

WithdrawalsvETH2 deployed to 0xed4e21BD620F3C1Fd1853b1C52A9D023C33D83d4 at
https://etherscan.io/address/0xed4e21BD620F3C1Fd1853b1C52A9D023C33D83d4

Rollover deployed to 0x68a31dfD0c81A411C5adadc8A40225425777466C at
https://etherscan.io/address/0x68a31dfD0c81A411C5adadc8A40225425777466C

## Aug 31 '21

NFT
MintableNFTSale deployed to 0x926a65012C23dcfB2227af46e6135C1c6413D8Ac at https://etherscan.io/address/0x926a65012C23dcfB2227af46e6135C1c6413D8Ac
cost: 322125589811035895 or 0.322 ETH

founderVesting deployed to 0x0279eBC54179EBc5E5e65A9f036Db351233adDc6 at https://etherscan.io/address/0x0279eBC54179EBc5E5e65A9f036Db351233adDc6
treasuryVesting deployed to 0x2Cb4bdc030975f2ABdbbb984e87715505C51D5BC at https://etherscan.io/address/0x2Cb4bdc030975f2ABdbbb984e87715505C51D5BC
SGTv2 deployed to 0x24C19F7101c1731b85F1127EaA0407732E36EcDD at https://etherscan.io/address/0x24C19F7101c1731b85F1127EaA0407732E36EcDD

TokenMigrator deployed to 0x9615460582Efa2a9b1d8D21e7E02afE43A415E13 at https://etherscan.io/address/0x9615460582Efa2a9b1d8D21e7E02afE43A415E13
VoteEscrowFactory deployed to 0xeE5bd4b9C875BE3958b1255D181B8B3E978903b9 at https://etherscan.io/address/0xeE5bd4b9C875BE3958b1255D181B8B3E978903b9
SimpleTimelock deployed to 0xC0AAB794F9D2aA7cE56B8BEB6cFfc71BC05c21FC at https://etherscan.io/address/0xC0AAB794F9D2aA7cE56B8BEB6cFfc71BC05c21FC
FundDistributor deployed to 0x38aa4CC003D9Ad84505bc7b096122402Db31f708 at https://etherscan.io/address/0x38aa4CC003D9Ad84505bc7b096122402Db31f708
MasterChef deployed to 0x84B7644095d9a8BFDD2e5bfD8e41740bc1f4f412 at https://etherscan.io/address/0x84B7644095d9a8BFDD2e5bfD8e41740bc1f4f412

VeSGT : 0x21b555305e9d65c8b8ae232e60fd806edc9c5d78 : https://etherscan.io/address/0x21b555305e9d65c8b8ae232e60fd806edc9c5d78#code

# Goerli

## Fri jul 7 23

SharedDepositMinterV2 deployed to 0x1C974Ef3993152eCB53FdCF8b543b39f82122447 at https://goerli.etherscan.io/address/0x1C974Ef3993152eCB53FdCF8b543b39f82122447

PaymentSplitter deployed to 0xa609E0Dd2475739ac705fc17f38D9F5584c2c28D at https://goerli.etherscan.io/address/0xa609E0Dd2475739ac705fc17f38D9F5584c2c28D

Withdrawals deployed to 0x807EB95706E365115adAbeb4884c1Eb39D062A6d at https://goerli.etherscan.io/address/0x807EB95706E365115adAbeb4884c1Eb39D062A6d

RewardsReceiver deployed to 0x67c2F94F308F7fe6Dd1bf1bD7BF55715E1b1579b at https://goerli.etherscan.io/address/0x67c2F94F308F7fe6Dd1bf1bD7BF55715E1b1579b

## Wed jul 6 '23

SharedDepositMinterV2 deployed to 0x711c07cbfb82d5cB6Eb665350237C25c302f4A13 at https://goerli.etherscan.io/address/0x711c07cbfb82d5cB6Eb665350237C25c302f4A13

PaymentSplitter deployed to 0xA64629072cb064B2F3084Ca4C2D9d1e2F5c1fe02 at https://goerli.etherscan.io/address/0xA64629072cb064B2F3084Ca4C2D9d1e2F5c1fe02

Withdrawals deployed to 0x01cF4caDca14a9988F9116d7701494e58E567528 at https://goerli.etherscan.io/address/0x01cF4caDca14a9988F9116d7701494e58E567528

YieldDirector deployed to 0xc539a20b49DDe9a0E86b3FF5e00CCD5519001114 at https://goerli.etherscan.io/address/0xc539a20b49DDe9a0E86b3FF5e00CCD5519001114

RewardsReceiver deployed to 0x3048D0A5813dFcB7aD4Dbb2f747E993aF8b70E8a at https://goerli.etherscan.io/address/0x3048D0A5813dFcB7aD4Dbb2f747E993aF8b70E8a

## Wed jul 5 '23

SharedDepositMinterV2 deployed to 0x5d03e8d58A58244DB0ad5D4CEc7DC7737F2F37a3 at https://goerli.etherscan.io/address/0x5d03e8d58A58244DB0ad5D4CEc7DC7737F2F37a3

## Sun jul 2 '23

SharedDepositMinterV2 deployed to 0x5464Eb94ECf019d5b05099A89dB302cF7ac3e863 at https://goerli.etherscan.io/address/0x5464Eb94ECf019d5b05099A89dB302cF7ac3e863

## Wed Jun 14 '23

SgETH deployed to 0x453B459249F82ba3f369651aD485Fa11C6F082F8 at https://goerli.etherscan.io/address/0x453B459249F82ba3f369651aD485Fa11C6F082F8
WSGETH deployed to 0xbFA813C3266Af70A5Ddc15d9253655281e2bCd23 at https://goerli.etherscan.io/address/0xbFA813C3266Af70A5Ddc15d9253655281e2bCd23
SharedDepositMinter deployed to 0xb5ae9d51858436c23dca94370a38ff495a54873b at https://goerli.etherscan.io/address/0xb5ae9d51858436c23dca94370a38ff495a54873b
PaymentSplitter deployed to 0xC01063EC89B210BE8037d549D618980845657994 at https://goerli.etherscan.io/address/0xC01063EC89B210BE8037d549D618980845657994
Withdrawals deployed to 0x765d0dA8536cE858E0D2B54025b223231db0FeAE at https://goerli.etherscan.io/address/0x765d0dA8536cE858E0D2B54025b223231db0FeAE
ETH2SgETHYieldRedirector deployed to 0x8253F05c5E7b76F5ff855a6D52Ea9B9B5FD666cA at https://goerli.etherscan.io/address/0x8253F05c5E7b76F5ff855a6D52Ea9B9B5FD666cA
RewardsReceiver deployed to 0xC9F2ddBf105ff67c2BA30b2dB968Bc564a16ca67 at https://goerli.etherscan.io/address/0xC9F2ddBf105ff67c2BA30b2dB968Bc564a16ca67
WithdrawalsvETH2 deployed to 0xd70201Ea40c12cFE6Bf69Dc9A2ca9FB14bb8DB0b at https://goerli.etherscan.io/address/0xd70201Ea40c12cFE6Bf69Dc9A2ca9FB14bb8DB0b
Rollover deployed to 0xaa93EF92Ef8663902BeE679B9B8bFB60c966d50C at https://goerli.etherscan.io/address/0xaa93EF92Ef8663902BeE679B9B8bFB60c966d50C

## Wed Jun 7 '23

SgETH deployed to 0xd0f593aeB7E22B1038edC398aA53A56B38435de9 at https://goerli.etherscan.io/address/0xd0f593aeB7E22B1038edC398aA53A56B38435de9
WSGETH deployed to 0xCE066A0C47b95aA7fF53A22D099A1F33F3d7e7D9 at https://goerli.etherscan.io/address/0xCE066A0C47b95aA7fF53A22D099A1F33F3d7e7D9
SharedDepositMinter deployed to 0x62a4f18E1c42c63c6D02668A714eaD7323eF5CE0 at https://goerli.etherscan.io/address/0x62a4f18E1c42c63c6D02668A714eaD7323eF5CE0
PaymentSplitter deployed to 0xBaB96eEEE86b3dc57378C2b95aaFEc0aD3cc1Ed5 at https://goerli.etherscan.io/address/0xBaB96eEEE86b3dc57378C2b95aaFEc0aD3cc1Ed5
Withdrawals deployed to 0x62C4df1d2D30509833dEac78E968762Bf1B0CB6d at https://goerli.etherscan.io/address/0x62C4df1d2D30509833dEac78E968762Bf1B0CB6d
ETH2SgETHYieldRedirector deployed to 0xd810D44Ad63582C457814eD3a47e1d9B83aC2358 at https://goerli.etherscan.io/address/0xd810D44Ad63582C457814eD3a47e1d9B83aC2358
RewardsReceiver deployed to 0xf38bA1f9B416Ce6eB3D9336f417a5Fbf88aEb84F at https://goerli.etherscan.io/address/0xf38bA1f9B416Ce6eB3D9336f417a5Fbf88aEb84F
WithdrawalsvETH2 deployed to 0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a at https://goerli.etherscan.io/address/0x0f779f0c7d0c8b9cD6e23e62D9aE51ED39aa256a
Rollover deployed to 0x17b9Ee3963a58c82d64Aa9fdaCce261257834623 at https://goerli.etherscan.io/address/0x17b9Ee3963a58c82d64Aa9fdaCce261257834623

May 24 '23
Goerli test of streamlined Withdrawals contract
/// @dev Test on goerli deployed at https://goerli.etherscan.io/address/0x4db116ad5cca33ba5d2956dba80d56f27b6b2455
9 changes: 4 additions & 5 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require("hardhat-contract-sizer");
require("hardhat-abi-exporter");
require("dotenv").config();

let secrets = require("./secrets.js");
// let secrets = require("./secrets.js");
const path = require("path");

// This is a sample Hardhat task. To learn how to create your own go to
Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = {
},
mainnet: {
url: `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
accounts: [`0x${process.env.MAINNET_PRIVATE_KEY}`],
accounts: [`0x${process.env.MAINNET_PRIVATE_KEY ? process.env.MAINNET_PRIVATE_KEY : process.env.GOERLIPK}`],
chainId: chainIds.mainnet,
},
},
Expand All @@ -108,10 +108,9 @@ module.exports = {
// apiKey: secrets.ETHERSCAN_API,
apiKey: {
mainnet: process.env.ETHERSCAN_API,
goerli: process.env.ETHERSCAN_API
goerli: process.env.ETHERSCAN_API,
},
customChains: []

customChains: [],
},
contractSizer: {
alphaSort: true,
Expand Down
14 changes: 0 additions & 14 deletions test/sample-test.js

This file was deleted.

56 changes: 56 additions & 0 deletions test/v2/core/sgETH.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const {ethers} = require("hardhat");
const {expect} = require("chai");

describe("SgETH.sol", () => {
let sgEth, deployer, alice;
let MINTER_ROLE;

beforeEach(async () => {
const [owner, addr1] = await ethers.getSigners();

const SgETH = await ethers.getContractFactory("SgETH");
sgEth = await SgETH.deploy([]);
await sgEth.deployed();

deployer = owner;
alice = addr1;

MINTER_ROLE = await sgEth.MINTER();
});

it("addMinter", async () => {
await expect(sgEth.connect(alice).addMinter(alice.address)).to.be.revertedWith(
`AccessControl: account ${alice.address.toLowerCase()} is missing role ${ethers.constants.HashZero}`,
);
await expect(sgEth.connect(deployer).addMinter(ethers.constants.AddressZero)).to.be.revertedWith(
"Zero address detected",
);

await expect(sgEth.connect(deployer).addMinter(alice.address))
.to.be.emit(sgEth, "RoleGranted")
.withArgs(MINTER_ROLE, alice.address, deployer.address);
});

it("removeMinter", async () => {
await sgEth.connect(deployer).addMinter(alice.address);
await expect(sgEth.connect(alice).removeMinter(alice.address)).to.be.revertedWith(
`AccessControl: account ${alice.address.toLowerCase()} is missing role ${ethers.constants.HashZero}`,
);

await expect(sgEth.connect(deployer).removeMinter(alice.address))
.to.be.emit(sgEth, "RoleRevoked")
.withArgs(MINTER_ROLE, alice.address, deployer.address);
});

it("transferOwnership", async () => {
await expect(sgEth.connect(alice).transferOwnership(alice.address)).to.be.revertedWith(
`AccessControl: account ${alice.address.toLowerCase()} is missing role ${ethers.constants.HashZero}`,
);

await expect(sgEth.connect(deployer).transferOwnership(alice.address))
.to.be.emit(sgEth, "RoleGranted")
.withArgs(ethers.constants.HashZero, alice.address, deployer.address)
.and.to.be.emit(sgEth, "RoleRevoked")
.withArgs(ethers.constants.HashZero, deployer.address, deployer.address);
});
});
Loading

0 comments on commit ae40f84

Please sign in to comment.