* Install open zeppelin contracts
* Init foundry in governance
* Add wrapped ZRX token
* Add governance contracts testing to CI
* Set optimizer runs to default
* Upgrade to patched version of openzeppelin/contracts
* Test stakingakng / unwrapping ZRX
* Init npm package
* Lint fix, removing lib from gitignore
* Add openzeppelin contracts git submodule for foundry
* Add vanilla governor contract
* Fix reference paths to imported packages
* Temporarily switch to using a mocked version of ZRX
* Ignore foundry's lib in link checker
* Fix a conflict in gitignore between forge lib adn built lib
* Upload governance code coverage report to coveralls
* Flesh out test scenarios for wrapping/unwrapping
* Add basic ERC20 name and symbol tests
* Wire in basic timelock controller and governor test setup
* Test basic governor properties
* Add basic voting power delegation tests
* Add proposal execution happy path test
* Split ERC20Votes logic between wrapped token
and ZeroExVotes contracts
* Exclude BaseTest from coverage in coveralls
* Add protocol specific governor with produciton governance settings
* Add a dedicated instance for the treasury governor
This is currently using the default 1 token 1 vote mechanism but will be migrated
* Add test for updating governance settings
for voting delay, voting period and proposal threshold
* Create seperate timelock contract instance for treasury and protocol
* Test updating the timlock min delay
* Set timelock delay to 2 days for protocol and 1 sec for treasury
* Remove timelock from treasury governor
* Refactor _checkpointsLookup to return entire Checkpoint
instad of just number of votes
* Update the totalSupply checkpoints updating logic
* Quadratic voting power transfers and delegations
* Fix workflow yaml
* Initialise ZeroExVotes behind a ERC1967Proxy
Test it cannot be reinitialised
* Remove obsoleted console.logs from test
* Storage pack Checkpoint enum
* Remove keeping track of total balances for voting
* Switch to using the foundry artifact in test
* Fix rebase issue
* Add timelock control over the treasury governor
* Add test for wrapped token transfer
* Emit separate events for changing linear and quadratic voting power
* Add the ability to cancel a proposal
* Limit the governors' cancel function to security council only
* Eject security council after a proposal is cancelled
* Add ability for governance to set the security council
* Merge the governors test suites into one reusable set of tests
* Add an empty test function to base test contract
to remove it from coverage reports. Fudge but no other way to ignore it in report
* Security council can rollback protocol upgrades
* Upgrade to solidity 0.8.19
* Move IZeroExGovernor to src
* Abstract Security council interface into its own
* Emit events when assigning and ejecting the security council
* Use a cast to bytes4 instead of LibBytes
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
* Writing total supply checkpoints and setup of
quorum percentage of quadratic total supply for treasure governor
* Add test for transferring tokens when delegating
* Rename IZeroExSecurityCouncil to ISecurityCouncil
* Add security council restrictions to governors
* Remove obsolete overflow check
* Improve test coverage
* Upgrade open-zeppelin contracts to 4.8.2
* Test delegation by signature
* Test non security council requests
to rollback protocol changes cannot be executed
* Better revert messages
* Test correct interfaces are supported
* Remove obsoleted funciton
* Further test delegation by signature scenario
* Split the delegation functionality tests
* Add test for initialisation of voting contract
* Add test for reading checkpoints
* Update code comments
* Fix compilation warnings
* Run smt checker
* Add checkpoint tests
* Rename parameter in moveEntireVotingPower to match the one in movePartialVotingPower
* Switch moveEntireVotingPower to a more generic moveVotingPower implementation
as in the open-zeppelin contracts
* Install foundry earlier in CI
* Switch movePartialVotingPower to the generic moveVotingPower implementation
* Write totalSupplyCheckpoints via the generic _writeCheckpoint
* Add threshold for quadratic voting power
* Remove autoinserted code by OZ
* Add openzeppelin/contracts-upgradable
* Add initializable base to Voting contract
* Fix terminogy error in natspec
* Fix code comment
* Remove obsoleted overrides and add a missing modifier to moveVotingPower
* Remove amount check
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
* Fix a calculation error and clean tests
* Update thresholds for treasury governor
* Fix testShouldNotBeAbleToDelegateWithSignatureAfterExpiry
* Update from @duncancmt
without "memory-safe" the IR optimizer produces significantly worse code and it disables the stack limit evader
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
* Add onlyProxy to initializer
* Fix quadratic voting weight base
* Rename voting parameter for clarity
* Make addresses immutable (#680)
* Make addresses immutable
* Fix linting issues
---------
Co-authored-by: elenadimitrova <elena@arenabg.com>
* Prevent griefing by a malicious ZeroExVotes upgrade (#681)
* Gas optimization
* Minimal change to prevent malicious ZeroExVotes from griefing
* Add demonstration of griefing upgrade
* Fix rebase issues with tests
* Fix prettier issues
* Add checks to test
---------
Co-authored-by: elenadimitrova <elena@arenabg.com>
* Rename SecurityCouncil contract
* Add timestamp to delegator balance updates
* Make quadraticThreshold `immutable` for gas efficiency
* Remove the logic for ejecting security council
* Switch balance timestamp to be a block number
* Test votes migration for adding a new vote weight mechanism (#674)
* Add Emacs files to .gitignore
* Make some functions unproected to demonstrate a migration
* Add example (broken) migration
* Add migration test for voting logic
* Try to simplify tests
* Fix compilation errors
* Fix underflow test with new logic
* Flesh out migration test for voting
* Replace cube root library
* Fix stack too deep in coverage
---------
Co-authored-by: elenadimitrova <elena@arenabg.com>
* Change test case to testFail
* Update contracts/governance/test/ZeroExVotesMigration.sol
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
---------
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
Co-authored-by: Duncan Townsend <git@duncancmt.com>
* add kyber elastic to ethereum and polygon
* add to arbitrum and avalanche
* added kyber quoter/router dummy addresses
* move kyberelastic test to a different file, fix some bugs with addresses, blocknumber
* lint
* Strip erc20 package of legacy nonsense and add foundry basics
* Make foundry build
* Remove obsoleted test/UntransferrableDummyERC20Token.sol contract
* Remove obsoleted ERC20 lib variant contracts
* Remove obsoleted DummyMultipleReturnERC20Token and DummyNoReturnERC20Token contracts
* Move test contract to dedicated folder
and remove obsoleted TypeScript contract wrappers
* Remove src/interfaces/IEtherToken.sol only used in
v3 staking which is being obsoleted [skip ci]
* Add foundry test for token
* Migrate ZRX token tests to foundry
* Fix paths to erc20 contracts
* Remove obsoleted references
* Pin erc20-contracts package on treasury
* Ignore foundry imports in link checker
* Run only forge tests for erc20 contracts
* Remove DummyERC20Token and its dependencies
* Merge IERC20TokenV06 and IERC20TokenV08
into range pragma to cover solidity 0.6.5 to 0.8.x
* Merge IEtherTokenV06 and IEtherTokenV08
into range pragma to cover solidity 0.6.5 to 0.8.x
* Migrate weth9 tests to foundry
* Upload code coverage for erc20 package
* Update changelog
* Fix review comments
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
---------
Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
* added initial foundry transformERC20 tests
* added foundry tests into CircleCI flow
* add verbosity for failing tests in CI
* revert wrong CI commands
* feat: Foundry, added some more deployments (#558)
* Added some more deployments
* Rename WETH9 to WETH9V06
* Set to 0.6.x
* fix typo
* remove commit with bad prettier changes
* working bridge Fills through weth transformer
* remove unused reference
* clean up tests
* added working otc fill through transformERC20 in FQT
* resolve file imports, add samplers, arbitrumBridgeAdatper, and new FQT version
* add extra 'v' for debugging verbosity
* add extra 'v' for debugging verbosity in circleci config
* remove old traces
* refactor rpc's out of foundry.toml and into .env for CI compatibility
* remove verbosity from CI command as its now defined in foundry.toml
* setup rpc's
* ignore foundry artifacts in prettier
* change naming in prettierignore
* move /samplers to the tests subdirectory, modify remappings to reflext change
* one more try 🤞
* change CI steps
* remove yarn from CI step
* get to the right directory
* update foundry before tests
* fix tip() deprecation and use deal()
* use deal() instead of vm.deal()
* try to get foundry to have the right directory structure by updating it
* I HATE THIS
* remove foundryup
* Fix prettier issues
* Remove obsoleted import
* Use forge native commands to
install deps and test and add the --root option
* Try using forge with working-directory flag in CI
* Use nightly foundry docker image
* Update rpc endpoints config in foundry
* move tests into /forked and /local
* rename tests
* add foundry profiles to CI
* try to fix CI
* 🔧 add foundry local and forked tests to workflow
* prettier and lint
* revert deps update
* remove all samplers and add uniswapV2 sampler to ForkUtils
* address jacobs comments
* cleanup and comment
* prettier and lint
* bump contracts-zero-ex version
* set func-name-mixedcase to off in solhint for elenas new changes
* max line length to warn
* add --fix for check-md
* Update ci.yml
* fix some nitpcks and leftover code
* fix inconsistent naming
* fix bridge adapter reverts and foundry cache
* migrate foundry integration tests to /tests
* refactor contract-addresses to use the contract-addresses package style nested json
* fix solhint
* fix contract linting errors
* dont check broken links in libraries
* move forge order in gh action for testing
* add env instead of vars
* try again
* fix github actions ordering
* update licence and address comments
* remove verbosity from foundry.toml
* fix contract lint
* move back to emitting an event until samplers can be integrated as some chains dont have uniswap as a source
* add uniswap v3 sampling code for future use
* remove uniswap v3 code as its not used
* fix lint
Co-authored-by: Noah Khamliche <0xnoah@Noahs-MacBook-Pro-2.local>
Co-authored-by: Jacob Evans <jacob@dekz.net>
Co-authored-by: elenadimitrova <elena@arenabg.com>
* Update coveralls link to point to protocol repo coverage
* Remove obsoleted ignores in .gitignore
* Run forge coverage in CI and upload results to coveralls
* Remove unused wrapper
* Remove legacy coverage setup
* Remove lcov-result-merger
* Add base-path setting to coverallsapp in CI
* Implement base instantiation of the ZeroEx proxy in foundry
and move TestZeroExFeature contract to the foundry mocks
* Migrate zero-ex tests to foundry
* Update copyright year
* Update contracts/zero-ex/tests/mocks/TestZeroExFeature.sol
Co-authored-by: Jacob Evans <jacob@dekz.net>
Co-authored-by: Jacob Evans <jacob@dekz.net>
* Remove contracts/zero-ex/contracts/test/TestBridge.sol
* Move foundry tests to their default location
* Wire up base foundry test and start moving
FlashWallet tests and mocks to foundry
* Move remaining FlashWallet contract tests to foundry
* Switch to foundry default cache config