Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added L2VotingPowerPaused and L2GovernorPaused contract with test cases #165

Merged
merged 16 commits into from
Jun 12, 2024

Conversation

Phanco
Copy link
Member

@Phanco Phanco commented Jun 11, 2024

What was the problem?

This PR resolves #164

How was it solved?

  • Added contracts L2GovernorPaused and L2VotingPowerPaused
  • Added deployment scripts for the contracts

How was it tested?

  • Added corresponding test cases

@Phanco Phanco force-pushed the 164-pause-contract-voting-power-governor branch from a7a34bf to 5ac3c6f Compare June 11, 2024 14:14
@Phanco Phanco marked this pull request as ready for review June 11, 2024 16:50
Copy link
Contributor

@matjazv matjazv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also implement shell script to pause DAO.
Reference implementation you may find here:
https://github.com/LiskHQ/lisk-contracts/blob/152-pause-claim-staking/script/paused/deployPausedStaking.sh

.gitmodules Outdated Show resolved Hide resolved
foundry.toml Outdated Show resolved Hide resolved
script/contracts/L2/paused/L2GovernorPaused.s.sol Outdated Show resolved Hide resolved
script/contracts/L2/paused/L2VotingPowerPaused.s.sol Outdated Show resolved Hide resolved
script/contracts/Utils.sol Show resolved Hide resolved
src/L2/paused/L2VotingPowerPaused.sol Outdated Show resolved Hide resolved
src/L2/paused/L2GovernorPaused.sol Outdated Show resolved Hide resolved
src/L2/paused/L2GovernorPaused.sol Show resolved Hide resolved
src/L2/paused/L2VotingPowerPaused.sol Outdated Show resolved Hide resolved
test/L2/paused/L2GovernorPaused.t.sol Show resolved Hide resolved
test/L2/paused/L2VotingPowerPaused.t.sol Show resolved Hide resolved
test/L2/paused/L2VotingPowerPaused.t.sol Outdated Show resolved Hide resolved
test/L2/paused/L2GovernorPaused.t.sol Outdated Show resolved Hide resolved
lib/forge-std Outdated Show resolved Hide resolved
Copy link
Contributor

@matjazv matjazv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

test/L2/paused/L2GovernorPaused.t.sol Outdated Show resolved Hide resolved
test/L2/paused/L2VotingPowerPaused.t.sol Outdated Show resolved Hide resolved
@Phanco Phanco requested a review from AndreasKendziorra June 12, 2024 12:41
@matjazv matjazv merged commit d7b4296 into development Jun 12, 2024
3 checks passed
@matjazv matjazv deleted the 164-pause-contract-voting-power-governor branch June 12, 2024 12:55
matjazv pushed a commit that referenced this pull request Jun 13, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 18, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 18, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 21, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 21, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 24, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 24, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv pushed a commit that referenced this pull request Jun 24, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv added a commit that referenced this pull request Jun 25, 2024
* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq

* Implement L2ClaimPaused version of L2Claim contract

* Ignore unreachable warning from ERC721Upgradeable.sol because of having L2LockingPositionPaused contract

* Implement paused version of Staking process

* Remove unneeded L2StakingPaused contract

* Add deploy shell script for paused Staking process

* Add deploy shell script for paused Claim process

* Add unit tests for paused version of contracts

* Fix deployment shell scripts

* Remove unneeded L2StakingPaused address

* Remove warnings because of forge-std upgrade

* Remove fixed version of Foundry from pr.yaml

* Add additional paused functions for Reward contract

* Modify deployment script to pause DAO and Staking functionalities at the same time

* Remove unneeded imports from pausable versions of contracts

* Remove deploying DAO when deploying Staking process

* Fix two unit tests

* Remove unneeded blank spaces

* Fix unit test for L2RewardPaused

---------

Co-authored-by: Franco NG <[email protected]>
matjazv pushed a commit that referenced this pull request Jun 26, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
matjazv added a commit that referenced this pull request Jun 26, 2024
* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq

* Implement L2ClaimPaused version of L2Claim contract

* Ignore unreachable warning from ERC721Upgradeable.sol because of having L2LockingPositionPaused contract

* Implement paused version of Staking process

* Remove unneeded L2StakingPaused contract

* Add deploy shell script for paused Staking process

* Add deploy shell script for paused Claim process

* Add unit tests for paused version of contracts

* Fix deployment shell scripts

* Remove unneeded L2StakingPaused address

* Remove warnings because of forge-std upgrade

* Remove fixed version of Foundry from pr.yaml

* Add additional paused functions for Reward contract

* Modify deployment script to pause DAO and Staking functionalities at the same time

* Remove unneeded imports from pausable versions of contracts

* Remove deploying DAO when deploying Staking process

* Fix two unit tests

* Remove unneeded blank spaces

* Fix unit test for L2RewardPaused

---------

Co-authored-by: Franco NG <[email protected]>
shuse2 pushed a commit that referenced this pull request Jun 26, 2024
…es (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq
shuse2 pushed a commit that referenced this pull request Jun 26, 2024
* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq

* Implement L2ClaimPaused version of L2Claim contract

* Ignore unreachable warning from ERC721Upgradeable.sol because of having L2LockingPositionPaused contract

* Implement paused version of Staking process

* Remove unneeded L2StakingPaused contract

* Add deploy shell script for paused Staking process

* Add deploy shell script for paused Claim process

* Add unit tests for paused version of contracts

* Fix deployment shell scripts

* Remove unneeded L2StakingPaused address

* Remove warnings because of forge-std upgrade

* Remove fixed version of Foundry from pr.yaml

* Add additional paused functions for Reward contract

* Modify deployment script to pause DAO and Staking functionalities at the same time

* Remove unneeded imports from pausable versions of contracts

* Remove deploying DAO when deploying Staking process

* Fix two unit tests

* Remove unneeded blank spaces

* Fix unit test for L2RewardPaused

---------

Co-authored-by: Franco NG <[email protected]>
shuse2 pushed a commit that referenced this pull request Jul 11, 2024
* Add SwapAndBridge contract and Lido deployment and tests

* SwapAndBridge: Remove duplicate variables, add check against 0 address in constructor, and add slippage check

* SwapAndBridge: Remove duplicate variables, add check against 0 address in constructor, and add slippage check

* Added e2e tests.

* clean up deploy.sh

* SwapAndBridge.sol: add docs to constructor

* Clean up test

* update .env.example

* Clean up deployment script

* Clean up env file

* Add more balance for tests

* Add unit tests

* forge install: solady

v0.0.180

* remove unused contracts, update tests

* automate deployment

* fix env.example

* cleanup SwapAndBridge tests

* address review

* update contract license

* address review

* Fix E2E tests for Diva

* Minor fixes to Utils.sol

* Update Utils.sol with SwapAndBridge functionalities

* Fix import in Utils.sol

* Fix import in Utils.sol

* Fix variable usage

* Move env variables to contract constants to fix CI

* Fix formatting

* Remove use of env variables

* remove unused TOKEN_HOLDER_PRIV_KEY variable

* Save temporary data files to local storage

* fix fmt

* Move e2e tests to script

* Move integration tests to script; add unit tests

* remove old test folder

* Fix integration tests

* remove unnecessary function

* Add new unit tests

* Add mock contracts

* add tests for L2WdivETH

* Add AccessControl to VestingWallet

* Add NatSpec comments

* Update contract owner

* Added NatSpec and beneficiary check

* Remove redundant mappings

* Improve contract interface

* Increase test coverage

* Update data for Testnet migration (#135)

Merkle root was added and unneeded account removed from accounts_2.json

* Add address checking to contract

* Update error message

* Add virtual to functions

* Vesting Wallet on Ethereum L1 Mainnet (#123)

* Added L1VestingWallet, added testnet Vesting Plans, Added L1 Vesting deployment script

* Updated vesting plans script

* Update vesting data

* Add explanation to L1VestingWallet

* Update format

* Update READMEs

* Update vesting amount

* Update vesting amounts

* Update devnet data

* Update according to suggestion

* Update L1 contract code and deployment scripts

* Update README

* Update PR review

* Use OptimismMintableERC20Factory for Diva ERC20

* remove optimism library

* remove unnecessary contracts

* add deployment scripts

* fixing e2e

* fix e2e tests

* remove optimism lib

* fix e2e tests

* Add Airdrop contract Testnet deployment data (#159)

* Set 6_deployUSDTContract.sh script file as executable

* Set 5_deployAirdropContract.sh script file as executable

* Add Airdrop contract deployment data

* Fix GitHub CI regarding Forge version

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases (#165)

* Added L2VotingPowerPaused and L2GovernorPaused contract with test cases

* Add deployment script

* Update git submodules

* Add foundry.toml

* Change version function to be independent

* Update comments

* Update gitsubmodule, added Custom Errors

* Rearrange functions according to requirements

* pump forge-std to 1.8.2

* Add onReceive ERC721 and ERC1155 check

* Test adjustVotingPower is unpaused

* Add deployPausedDAO.sh

* Add forge clean to deploy script

* Clean before every forge script runs

* Used `../../` to navigate paused script

* rename assertInitParamsEq

* Merkle root for Airdrop contract is set inside deployment script (#161)

Set Merkle root on Airdrop contract deployment

* Add automated toolings for testing contracts (#151)

* Add Slither support in GH actions

* Add slither-mutate support for local execution

* Add readme for test directory

* Fix rebasing with development

* Add Echidna support for local execution

* Fix spelling typo

* fix env files

* forge install: openzeppelin-contracts

v5.0.2

* forge install: openzeppelin-contracts-upgradeable

v5.0.2

* forge install: openzeppelin-contracts

01ef448981be9d20ca85f2faf6ebdf591ce409f3

* forge install: openzeppelin-contracts-upgradeable

fbdb824a735891908d5588b28e0da5852d7ed7ba

* forge install: forge-std

v1.8.2

* cleanup

* cleanup

* address Slither and Matjaz comments

* add extra deployment checks

* Update script/swap_and_bridge/example/README.md

Co-authored-by: Matjaz Verbole <[email protected]>

* Update pr.yaml

* improving deployment script

* improving testing scripts

* improve test scripts and rename folder

* Address review comments

* Fix contracts folder path inside deployment directory

* Fix typo in e2e test and move contracts to test folder

* remove unnecessary interaction with deployment folder

* Fix contracts folder path inside deployment directory

* add testing contracts

* merge from development

* fix sed rule

* remove store of L@_DIVA_TOKEN

* Improve README file

* add readme

* fix typo

* add readme

* change folder structure

* Update script/swap_and_bridge/README.md

Co-authored-by: Matjaz Verbole <[email protected]>

---------

Co-authored-by: Franco NG <[email protected]>
Co-authored-by: Matjaz Verbole <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pause contract for L2Governor and L2VotingPower
3 participants