Skip to content

Commit

Permalink
Merge pull request #227 from Axis-Fi/develop
Browse files Browse the repository at this point in the history
Staging: Develop -> Master
  • Loading branch information
Oighty authored Jul 17, 2024
2 parents 76e4b84 + 4e00b41 commit 996044d
Show file tree
Hide file tree
Showing 373 changed files with 926 additions and 74,720 deletions.
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

0 comments on commit 996044d

Please sign in to comment.