Skip to content

Commit

Permalink
Merge branch 'eyqs/NES-188' into eyqs/NES-186
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs committed Sep 13, 2024
2 parents 794aeff + 91fbb31 commit ebfc2f0
Show file tree
Hide file tree
Showing 15 changed files with 321 additions and 158 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## What's new in this PR?

In bullet point format, please describe what's new in this PR.

## Why?

What problem does this solve?
Why is this important?
What's the context?
45 changes: 45 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Build and Test Contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

# - name: Run Forge build
# run: |
# forge --version
# forge build nest --sizes
# id: build

- name: Run Forge format
run: |
forge fmt nest --check
id: format

# - name: Run Forge tests
# run: |
# forge test nest -vvv
# id: test
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "nest/lib/openzeppelin-contracts-upgradeable"]
path = nest/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "nest/lib/openzeppelin-foundry-upgrades"]
path = nest/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
15 changes: 15 additions & 0 deletions foundry-template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/18230/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
9 changes: 9 additions & 0 deletions foundry-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Foundry Template Setup

Copy this folder to start a new Foundry project, then run the following to initialize the submodules:

```bash
$ forge install foundry-rs/forge-std
$ forge install OpenZeppelin/openzeppelin-foundry-upgrades
$ forge install OpenZeppelin/openzeppelin-contracts-upgradeable
```
26 changes: 26 additions & 0 deletions foundry-template/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[profile.default]
solc = "0.8.25"
evm_version = "cancun"
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

[fmt]
single_line_statement_blocks = "multi"
multiline_func_header = "params_first"
sort_imports = true
contract_new_lines = true
bracket_spacing = true
int_types = "long"
quote_style = "double"
number_underscore = "thousands"
wrap_comments = true

remappings = [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
]
34 changes: 0 additions & 34 deletions nest/.github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions nest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ out/
# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/18230/
/broadcast/**/dry-run/

# Docs
Expand Down
22 changes: 21 additions & 1 deletion nest/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
[profile.default]
solc = "0.8.25"
evm_version = "cancun"
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
[fmt]
single_line_statement_blocks = "multi"
multiline_func_header = "params_first"
sort_imports = true
contract_new_lines = true
bracket_spacing = true
int_types = "long"
quote_style = "double"
number_underscore = "thousands"
wrap_comments = true

remappings = [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
]
1 change: 1 addition & 0 deletions nest/lib/openzeppelin-foundry-upgrades
12 changes: 0 additions & 12 deletions nest/script/Counter.s.sol

This file was deleted.

28 changes: 28 additions & 0 deletions nest/script/DeployNestContracts.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import "forge-std/Script.sol";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Upgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol";

import { FakeComponentToken } from "../src/FakeComponentToken.sol";

contract DeployNestContracts is Script {

address private constant ARC_ADMIN_ADDRESS = 0x1c9d94FAD4ccCd522804a955103899e0D6A4405a;
address private constant USDC_ADDRESS = 0x849c25e6cCB03cdc23ba91d92440dA7bC8486be2;

function run() external {
vm.startBroadcast(ARC_ADMIN_ADDRESS);

address fakeComponentTokenProxy = Upgrades.deployUUPSProxy(
"FakeComponentToken.sol",
abi.encodeCall(FakeComponentToken.initialize, (msg.sender, "Banana", "BAN", IERC20(USDC_ADDRESS), 18))
);
console.log("FakeComponentToken deployed to:", fakeComponentTokenProxy);

vm.stopBroadcast();
}

}
Loading

0 comments on commit ebfc2f0

Please sign in to comment.