Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Apr 24, 2024
1 parent f8a5096 commit ea3523f
Show file tree
Hide file tree
Showing 14 changed files with 5,528 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @owner will be requested for review when someone opens a
# pull request.
* @hackfisher @xiaoch05 @hujw77
26 changes: 26 additions & 0 deletions .github/workflows/sphinx.dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sphinx Dry Run
env:
SPHINX_API_KEY: ${{ secrets.SPHINX_API_KEY }}

on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'

jobs:
sphinx-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Install Sphinx Solidity Library
run: yarn sphinx install
- name: Dry Run
run: npx sphinx propose ./script/common/Automation.s.sol --dry-run --networks mainnets
26 changes: 26 additions & 0 deletions .github/workflows/sphinx.propose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sphinx Propose
env:
SPHINX_API_KEY: ${{ secrets.SPHINX_API_KEY }}

on:
push:
branches:
- main
paths-ignore:
- '**.md'

jobs:
sphinx-propose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Install Sphinx Solidity Library
run: yarn sphinx install
- name: Propose
run: npx sphinx propose ./script/common/Automation.s.sol --confirm --networks mainnets
15 changes: 15 additions & 0 deletions .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/**/dry-run/

# Dotenv file
.env

# Node
node_modules/
dist/
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "lib/sphinx"]
path = lib/sphinx
url = https://github.com/sphinx-labs/sphinx
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.PHONY: all fmt clean dry-run propose
.PHONY: tools foundry sync sphinx

-include .env

all :; @forge build
fmt :; @forge fmt
clean :; @forge clean

propose:; npx sphinx propose ./script/common/Automation.s.sol --networks mainnets
dry-run:; npx sphinx propose ./script/common/Automation.s.sol --networks mainnets --dry-run

sphinx :; @yarn sphinx install
sync :; @git submodule update --recursive
tools : foundry
foundry:; curl -L https://foundry.paradigm.xyz | bash
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# Helix DAO

## Sphinx Safe Address
```sh
0xD0a0899c5dc2FEb253D57Ab0b7c6d1b1Fcbbf824
```
# relayer-automation
15 changes: 15 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[profile.default]
solc_version = "0.8.17"
script = 'script'
test = 'test'
extra_output = ['storageLayout']
fs_permissions=[{access="read", path="./out"}, {access="read-write", path="./cache"}]
allow_paths = ["../.."]
auto_detect_remappings = false
libs = ["lib"]

[rpc_endpoints]
anvil = "http://127.0.0.1:8545"
polygon = "https://polygon-rpc.com"
optimism = "https://rpc.ankr.com/optimism "
arbitrum = "https://arb1.arbitrum.io/rpc"
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"@sphinx-labs/plugins": "0.31.6"
}
}
4 changes: 4 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@sphinx-labs/contracts/=lib/sphinx/packages/contracts/contracts/foundry
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
forge-std/=lib/forge-std/src/
ds-test/=lib/forge-std/lib/ds-test/src/
14 changes: 14 additions & 0 deletions script/1_Action.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Base} from "./common/Base.sol";

interface III {
}

contract Action1 is Base {

function run() public sphinx {
// your script
}
}
6 changes: 6 additions & 0 deletions script/common/Automation.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Action1} from "../1_Action.s.sol";

contract Automation is Action1 {}
16 changes: 16 additions & 0 deletions script/common/Base.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Script} from "forge-std/Script.sol";
import "@sphinx-labs/contracts/SphinxPlugin.sol";

contract Base is Sphinx, Script {
function configureSphinx() public override {
sphinxConfig.owners = [
];
sphinxConfig.orgId = "cluanacaw000111jik4xs4wkl";
sphinxConfig.threshold = 0;
sphinxConfig.projectName = "Relayer-Automation";
sphinxConfig.mainnets = [];
}
}
Loading

0 comments on commit ea3523f

Please sign in to comment.