Skip to content

Commit

Permalink
Ready to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Oct 31, 2024
1 parent 73c5a13 commit e9fa39b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WARMUP_PERIOD="259200" # 3 days
COOLDOWN_PERIOD="259200" # 3 days

# Min seconds a user must have locked in escrow before they can queue an exit
MIN_LOCK_DURATION="259200" # 3 days
MIN_LOCK_DURATION="3600" # 1 hour

# Prevent voting until manually activated by the multisig
VOTING_PAUSED=true
Expand Down
6 changes: 6 additions & 0 deletions .env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ TEST_TOKEN_WHALE="0x0000000000000000000000000000000000000000"
# If you are testing with `make test-fork-factory-*`, you need to define the address of the
# existing factory to use. Otherwise, you should use `make test-fork-*`
FACTORY_ADDRESS="0x0000000000000000000000000000000000000000"

# The block number to run fork tests on
# If left empty, the live onchain state will be used, which may
# consume API calls or cause rate limits
FORK_TESTNET_BLOCK_NUMBER=2643743
FORK_PRODNET_BLOCK_NUMBER=
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ test-fork-mint-prodnet: test-fork-prodnet ## Clean fork test, minting test token

test-fork-testnet: export RPC_URL = $(TESTNET_RPC_URL)
test-fork-prodnet: export RPC_URL = $(PRODNET_RPC_URL)
test-fork-testnet: export FORK_BLOCK_NUMBER = $(FORK_TESTNET_BLOCK_NUMBER)
test-fork-prodnet: export FORK_BLOCK_NUMBER = $(FORK_PRODNET_BLOCK_NUMBER)

test-fork-testnet: test-fork ## Fork test using the existing token(s), new factory (testnet)
test-fork-prodnet: test-fork ## Fork test using the existing token(s), new factory (production network)
Expand All @@ -97,7 +99,16 @@ test-fork-factory-prodnet: test-fork-prodnet ## Fork test using an existing fact

.PHONY: test-fork
test-fork:
forge test --match-contract $(E2E_TEST_NAME) --rpc-url $(RPC_URL) $(VERBOSITY)
@if [ -z "$(strip $(FORK_BLOCK_NUMBER))" ] ; then \
forge test --match-contract $(E2E_TEST_NAME) \
--rpc-url $(RPC_URL) \
$(VERBOSITY) ; \
else \
forge test --match-contract $(E2E_TEST_NAME) \
--rpc-url $(RPC_URL) \
--fork-block-number $(FORK_BLOCK_NUMBER) \
$(VERBOSITY) ; \
fi

: ##

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Check the available make targets to simulate and deploy the smart contracts:
- [ ] I have updated the `CurveConstantLib` and `Clock` with any new constants.
- [ ] All my unit tests pass (`make test`)
- **Target test network**
- [ ] I have defined `FORK_TESTNET_BLOCK_NUMBER` on `.env.test`, with the current block number
- [ ] I have run a fork test in `new-factory` mode with minted tokens against the official OSx contracts on the testnet
- `make test-fork-mint-testnet`
- [ ] I have deployed my contracts successfully to the target testnet
Expand All @@ -145,6 +146,7 @@ Check the available make targets to simulate and deploy the smart contracts:
- [ ] I have confirmed that tests still work in `existing-factory` mode with the live token(s) and the already deployed factory on the testnet.
- `make test-fork-factory-testnet`
- **Target production network**
- [ ] I have defined `FORK_PRODNET_BLOCK_NUMBER` on `.env.test`, with the current block number
- [ ] I have run a fork test in `new-factory` mode with minted tokens against the official OSx contracts on the prodnet
- `make test-fork-mint-prodnet`
- If the live token has an address holding ≥ 3000 tokens on the prodnet:
Expand Down
3 changes: 1 addition & 2 deletions test/base/AragonTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ pragma solidity ^0.8.17;
import {IPluginSetup, PluginSetup} from "@aragon/osx/framework/plugin/setup/PluginSetup.sol";
import {DAO} from "@aragon/osx/core/dao/DAO.sol";
import {RATIO_BASE} from "@aragon/osx/plugins/utils/Ratio.sol";
import {ALICE_ADDRESS, BOB_ADDRESS, CAROL_ADDRESS, DAVID_ADDRESS, TAIKO_BRIDGE_ADDRESS} from "../constants.sol";
import {ALICE_ADDRESS, BOB_ADDRESS, CAROL_ADDRESS, DAVID_ADDRESS} from "../constants.sol";
import {Test} from "forge-std/Test.sol";

contract AragonTest is Test {
address immutable alice = ALICE_ADDRESS;
address immutable bob = BOB_ADDRESS;
address immutable carol = CAROL_ADDRESS;
address immutable david = DAVID_ADDRESS;
address immutable taikoBridge = TAIKO_BRIDGE_ADDRESS;
address immutable randomWallet = vm.addr(1234567890);

address immutable DAO_BASE = address(new DAO());
Expand Down
1 change: 0 additions & 1 deletion test/constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ address constant ALICE_ADDRESS = address(0xa11ce);
address constant BOB_ADDRESS = address(0xB0B);
address constant CAROL_ADDRESS = address(0xc4601);
address constant DAVID_ADDRESS = address(0xd471d);
address constant TAIKO_BRIDGE_ADDRESS = address(0xb61d6e);

0 comments on commit e9fa39b

Please sign in to comment.