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

Staging: Develop -> Master #227

Merged
merged 57 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
db48066
Update example .env file
0xJem Jul 12, 2024
bd6da43
chore: linting
0xJem Jul 12, 2024
cfa84f2
Merge pull request #221 from Axis-Fi/linting
0xJem Jul 12, 2024
9bb4bed
Add forge-std 1.9.1 as a dependency using soldeer. Updated from 1.7.1…
0xJem Jul 12, 2024
73546ba
Remove unused prb-math dependency
0xJem Jul 12, 2024
a1b7d3f
Shift to solmate 6.7.0 from soldeer. Adds ERC6909 contract not includ…
0xJem Jul 12, 2024
27fc801
Remove solmate from installation script
0xJem Jul 12, 2024
243461c
Shift to using solady 0.0.124 package in soldeer (same version).
0xJem Jul 12, 2024
e3cf82c
Shift to openzeppelin 4.9.2 package in soldeer (includes the upgradea…
0xJem Jul 12, 2024
8d7a0b5
Remove openzeppelin from install script
0xJem Jul 12, 2024
332252d
Shift to uniswap-v2-core 1.0.1 package in soldeer (same version)
0xJem Jul 12, 2024
e74a7bb
Install soldeer dependencies in install script
0xJem Jul 12, 2024
bdff393
chore: linting
0xJem Jul 12, 2024
d80f2b2
Update salts
0xJem Jul 12, 2024
14a5d4a
Install uniswap-v3 core 1.0.1 (same version) from soldeer. Removed re…
0xJem Jul 15, 2024
8edc2e8
Update salts
0xJem Jul 15, 2024
a02557a
chore: linting
0xJem Jul 15, 2024
72e003a
Update salts
0xJem Jul 15, 2024
cde033c
Merge branch 'master' into soldeer
0xJem Jul 15, 2024
8cc3540
Update salts
0xJem Jul 15, 2024
baf4a2f
Simplify first-run scripts and CI build
0xJem Jul 15, 2024
4c024a4
Document use of soldeer
0xJem Jul 15, 2024
63d8635
Document minimum version of soldeer
0xJem Jul 15, 2024
610ee34
Pin solmate to git commit in order to include ERC6909.
0xJem Jul 15, 2024
7171cfc
Bring LinearVesting under the size limit
0xJem Jul 15, 2024
43c46cd
WIP publish script
0xJem Jul 15, 2024
05034c5
Finalise publish script
0xJem Jul 15, 2024
30732b7
Add changelog
0xJem Jul 15, 2024
c7c46a3
Remove redundant MockERC6909
0xJem Jul 15, 2024
948a293
Shift to soldeer-provided clones-with-immutable-args
0xJem Jul 16, 2024
e553691
Adjust version of clones-with-immutable-args to be the same commit as…
0xJem Jul 16, 2024
19ee0d7
Shift callbacks to axis-periphery. Remove git subtrees used by callba…
0xJem Jul 16, 2024
85e4075
Temporarily remove references to DTL callbacks
0xJem Jul 16, 2024
79eb8ca
Update test salts
0xJem Jul 16, 2024
21457c7
WIP: shift imports to be relative, in order to fix remappings for dow…
0xJem Jul 16, 2024
7629f6f
Remove remaining relative imports
0xJem Jul 16, 2024
020c8a9
Update salts
0xJem Jul 16, 2024
a25d5bc
Remove deployment sequences for callbacks
0xJem Jul 16, 2024
c91541f
Remove redundant dependencies
0xJem Jul 16, 2024
dbde451
Update docs. Remove expectation of soldeer CLI.
0xJem Jul 16, 2024
eedb7ac
Add dependencies/ to solhint ignore file
0xJem Jul 16, 2024
84b8748
Clean up solhint ignore
0xJem Jul 16, 2024
cf614f3
chore: linting
0xJem Jul 16, 2024
79d44df
chore: linting
0xJem Jul 16, 2024
7ce898d
Remove addresses shifted into axis-periphery
0xJem Jul 16, 2024
1985859
Port changes to WithEnvironment from Axis-Fi/axis-periphery@dbf92710d…
0xJem Jul 16, 2024
dbb1947
chore: linting
0xJem Jul 16, 2024
623ca2e
Remove redundant docs
0xJem Jul 16, 2024
d07b331
Experiment: revert implicit imports (#223)
0xJem Jul 16, 2024
a7eee2a
Case-sensitive filename
0xJem Jul 16, 2024
a44a9b2
Add documentation on updating dependencies
0xJem Jul 17, 2024
9d7ebd5
Merge branch 'master' into develop
Oighty Jul 17, 2024
46102ff
chore: change license in package.json to match
Oighty Jul 17, 2024
e19ca19
Merge pull request #222 from Axis-Fi/soldeer
Oighty Jul 17, 2024
b13c44d
chore: move BaseCallback to bases folder
Oighty Jul 17, 2024
f02fe38
Merge branch 'develop' into periphery-migration
Oighty Jul 17, 2024
4e00b41
Merge pull request #225 from Axis-Fi/periphery-migration
Oighty Jul 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 7 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
RPC_URL=https://sepolia.blast.io
# Chain names based on: https://github.com/alloy-rs/chains/blob/main/src/named.rs
CHAIN=CHANGEME
RPC_URL=CHANGEME
ETHERSCAN_API_KEY=CHANGEME

DEPLOYER_PRIVATE_KEY=CHANGEME
DEPLOYER_ADDRESS=CHANGEME

# Blast verification
VERIFIER_URL=https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan
ETHERSCAN_API_KEY=verifyContract
# Set to override the default verifier URL for the chain
#VERIFIER_URL=
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
version: 9

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -48,24 +48,25 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Build local ecies-cli for use with testing
run: cd crates/ecies-cli && cargo build && cd ../..

- name: Repo Install Script
- name: Install Dependencies
run: |
chmod +x ./install.sh
./install.sh
pnpm install
shell: bash

- name: Run lint check
run: pnpm run lint:check

- name: Run Forge build
- name: Build Solidity Contracts
run: |
forge --version
forge build
id: build

- name: Build ECIES CLI
run: |
pnpm run build:ecies-cli
id: build-ecies-cli

- name: Run Forge tests
run: |
pnpm run test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ node_modules/

# Bytecode
bytecode/

# soldeer
dependencies/
27 changes: 0 additions & 27 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,27 +0,0 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/prb-math"]
path = lib/prb-math
url = https://github.com/PaulRBerg/prb-math
[submodule "lib/uniswap-v3-periphery"]
path = lib/uniswap-v3-periphery
url = https://github.com/uniswap/v3-periphery
[submodule "lib/uniswap-v3-core"]
path = lib/uniswap-v3-core
url = https://github.com/uniswap/v3-core
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/openzeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/uniswap-v2-core"]
path = lib/uniswap-v2-core
url = https://github.com/uniswap/v2-core
6 changes: 3 additions & 3 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib/**
dependencies/**
src/modules/Modules.sol
src/modules/Keycode.sol
src/lib/**
test/lib/uniswap-v2/*.sol
test/lib/uniswap-v3/*.sol
src/lib/clones/**
src/lib/permit2/**
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

## 0.5.1

- Migrates all dependencies over to soldeer packages and away from git submodules (#222)
- Removes redundant dependencies (prb-math, uniswap-v3-periphery) (#222)
- Packages the repository as a soldeer package (#222)
- Use implicit imports in interfaces (#223)
- Improvements to constant and deployment addresses (#220)

## 0.5.0

- Adds SVG for derivative tokens deployed using the LinearVesting module (#210)
- Define the referrer fee on a per-auction basis (#216)
- Standardise percentages on 2 basis points (100% = 100e2)
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Axis is built in Solidity using Foundry as the development and test environment.
### First-Run

```shell
pnpm run full-install
pnpm install
```

### Build
Expand Down Expand Up @@ -71,9 +71,8 @@ Many of the contracts (e.g. callbacks) require a specific address prefix or have

- The code of a callback contract has been changed
- This requires re-generating the salt for the contract. See the [test_salts.sh](/script/salts/test/test_salts.sh) script.
- There has been a change to the dependencies under `/lib`. The dependencies affect the build output, so any changes will affect the bytecode generated by the Solidity compiler.
- If the submodule change was inadvertent, this can be fixed by running `pnpm run full-install` to reset the changes.
- In some cases, such as the `g-uni-v1-core` dependency, installing npm packages will result in the remappings being changed. It is best to remove the dependency's respective dependencies in order to fix this.
- There has been a change to the dependencies under `/lib` or `/dependencies`. The dependencies affect the build output, so any changes will affect the bytecode generated by the Solidity compiler.
- If the change was inadvertent, this can be fixed by running `pnpm install` to reset the changes.
- If the change to dependencies and invalidation of salts is expected, then new salts must be generated. In some cases (such as Uniswap V2 and V3 factories), the new addresses must be recorded in the `Constants.sol` file.

### Format
Expand All @@ -96,4 +95,32 @@ Scripts are written in Solidity using Foundry and are divided into `deploy`, `sa

### Deployments

Deployments are listed in the [Axis documentation](https://docs.axis.finance/references/03-technical/).
Deployments are listed in the [env.json file](/script/env.json) and periodically updated in the [Axis documentation](https://axis.finance/developer/reference/contract-addresses).

### Dependencies

[soldeer](https://soldeer.xyz/) is used as the dependency manager, as it solves many of the problems inherent in forge's use of git submodules. Soldeer is integrated into `forge`, so should not require any additional installations.

NOTE: The import path of each dependency is versioned. This ensures that any changes to the dependency version result in clear errors to highlight the potentially-breaking change.

#### Updating Dependencies

When updating the version of a dependency provided through soldeer, the following must be performed:

1. Update the version of the dependency in `foundry.toml` or through `forge soldeer`
2. Re-run the [installation script](#first-run)
3. If the version number has changed:
- Change the existing entry in [remappings.txt](remappings.txt) to point to the new dependency version
- Update imports to use the new remapping

### Packaging

To publish a new package version to soldeer, run the following:

```shell
pnpm run publish <version>
```

On first run, this requires authentication with soldeer: `soldeer login`

The [CHANGELOG](CHANGELOG.md) file should also be updated.
9 changes: 7 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[profile.default]
src = "src"
out = "out"
# libs = ["lib"]
fs_permissions = [{access = "read-write", path = "./bytecode/"}, {access = "read", path = "./script/"}, {access = "read-write", path = "./deployments/"}]
ffi = true
solc_version = "0.8.19"
Expand All @@ -21,8 +20,14 @@ quote_style = "double"
number_underscore = "thousands"
wrap_comments = false
ignore = [
"lib/**",
"src/lib/**",
]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

[dependencies]
forge-std = { version = "1.9.1" }
solmate = { version = "6.7.0", url = "[email protected]:transmissions11/solmate.git", commit = "c892309933b25c03d32b1b0d674df7ae292ba925" }
solady = { version = "0.0.124" }
"@openzeppelin-contracts" = { version = "4.9.2" }
clones-with-immutable-args = { version = "1.1.1", git = "[email protected]:wighawag/clones-with-immutable-args.git", rev = "f5ca191afea933d50a36d101009b5644dc28bc99" }
56 changes: 0 additions & 56 deletions install.sh

This file was deleted.

1 change: 0 additions & 1 deletion lib/forge-std
Submodule forge-std deleted from f73c73
47 changes: 0 additions & 47 deletions lib/g-uni-v1-core/.circleci/config.yml

This file was deleted.

3 changes: 0 additions & 3 deletions lib/g-uni-v1-core/.env.example

This file was deleted.

6 changes: 0 additions & 6 deletions lib/g-uni-v1-core/.eslintignore

This file was deleted.

83 changes: 0 additions & 83 deletions lib/g-uni-v1-core/.eslintrc.json

This file was deleted.

Loading
Loading