-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7993818
Showing
42 changed files
with
4,818 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (C) 2024, Ava Labs, Inc. All rights reserved. | ||
# See the file LICENSE for licensing terms. | ||
|
||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
ignore: | ||
# Update go-ethereum only via subnet-evm or avalanchego | ||
- dependency-name: "github.com/ethereum/go-ethereum" | ||
# Avalanchego is updated to stay compatible with subnet-evm | ||
- dependency-name: "github.com/ava-labs/avalanchego" | ||
- package-ecosystem: "gitsubmodule" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: ABI Go Bindings Checker | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
abi_binding: | ||
name: abi_binding | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set Go version | ||
run: | | ||
source ./scripts/versions.sh | ||
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Install Foundry | ||
run: ./scripts/install_foundry.sh | ||
|
||
- name: Generate ABI Go bindings | ||
run: | | ||
export PATH=$PATH:$HOME/.foundry/bin | ||
export GOPATH=$HOME/go | ||
export PATH="$PATH:$GOPATH/bin" | ||
./scripts/abi_bindings.sh | ||
- name: Print diff | ||
run: git --no-pager diff -- abi-bindings/**.go | ||
|
||
- name: Fail if diff exists | ||
run: git --no-pager diff --quiet -- abi-bindings/**.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: go.mod Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
gomod_check: | ||
name: Check go.mod | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- run: | | ||
source ./scripts/versions.sh | ||
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- run: go mod tidy | ||
- run: git --no-pager diff -- go.mod go.sum # This prints the diff | ||
- run: git --no-pager diff --quiet -- go.mod go.sum # This errors if there is a diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
solhint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install solhint | ||
run: | | ||
npm install solhint -g | ||
solhint --version | ||
- name: Run Lint | ||
run: ./scripts/lint.sh --sol-lint | ||
|
||
format-solidity: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
run: ./scripts/install_foundry.sh | ||
|
||
- name: Check Solidity Formatting | ||
run: | | ||
export PATH=$PATH:$HOME/.foundry/bin | ||
./scripts/lint.sh --sol-format-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
solidity-unit-tests: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
run: ./scripts/install_foundry.sh | ||
|
||
- name: Run unit tests | ||
run: | | ||
export PATH=$PATH:$HOME/.foundry/bin | ||
cd contracts/ | ||
forge test -vvv | ||
e2e_tests: | ||
name: e2e_tests | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repositories and submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set Go version | ||
run: | | ||
source ./scripts/versions.sh | ||
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Install Foundry | ||
run: ./scripts/install_foundry.sh | ||
|
||
- name: Run E2E Tests | ||
# Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc | ||
run: | | ||
export PATH=$PATH:$HOME/.foundry/bin | ||
export PATH="$PATH:$GOPATH/bin" | ||
./scripts/e2e_test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
build/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
.vscode/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env | ||
|
||
# Ginkgo | ||
main.log | ||
server.log | ||
*.test | ||
|
||
# Forge documentation | ||
contracts/docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "contracts/lib/teleporter"] | ||
path = contracts/lib/teleporter | ||
url = [email protected]:ava-labs/teleporter.git | ||
[submodule "contracts/lib/forge-std"] | ||
path = contracts/lib/forge-std | ||
url = [email protected]:foundry-rs/forge-std.git | ||
[submodule "contracts/lib/solidity-merkle-trees"] | ||
path = contracts/lib/solidity-merkle-trees | ||
url = [email protected]:michaelkaplan13/solidity-merkle-trees.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file configures github.com/golangci/golangci-lint. | ||
|
||
run: | ||
timeout: 3m | ||
tests: true | ||
# skip auto-generated files. | ||
skip-dirs: | ||
- "abi-bindings/go" | ||
skip-files: | ||
- ".*mock.*" | ||
|
||
issues: | ||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- unconvert | ||
- unused | ||
- whitespace | ||
- lll | ||
|
||
linters-settings: | ||
gofmt: | ||
simplify: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Copyright (C) 2024, Ava Labs, Inc. All rights reserved. | ||
|
||
Ecosystem License | ||
Version: 1.1 | ||
|
||
Subject to the terms herein, Ava Labs, Inc. (**“Ava Labs”**) hereby grants you | ||
a limited, royalty-free, worldwide, non-sublicensable, non-transferable, | ||
non-exclusive license to use, copy, modify, create derivative works based on, | ||
and redistribute the Software, in source code, binary, or any other form, | ||
including any modifications or derivative works of the Software (collectively, | ||
**“Licensed Software”**), in each case subject to this Ecosystem License | ||
(**“License”**). | ||
|
||
This License applies to all copies, modifications, derivative works, and any | ||
other form or usage of the Licensed Software. You will include and display | ||
this License, without modification, with all uses of the Licensed Software, | ||
regardless of form. | ||
|
||
You will use the Licensed Software solely (i) in connection with the Avalanche | ||
Public Blockchain platform, having a NetworkID of 1 (Mainnet) or 5 (Fuji), and | ||
associated blockchains, comprised exclusively of the Avalanche X-Chain, | ||
C-Chain, P-Chain and any subnets linked to the P-Chain (“Avalanche Authorized | ||
Platform”) or (ii) for non-production, testing or research purposes within the | ||
Avalanche ecosystem, in each case, without any commercial application | ||
(“Non-Commercial Use”); provided that this License does not permit use of the | ||
Licensed Software in connection with (a) any forks of the Avalanche Authorized | ||
Platform or (b) in any manner not operationally connected to the Avalanche | ||
Authorized Platform other than, for the avoidance of doubt, the limited | ||
exception for Non-Commercial Use. Ava Labs may publicly announce changes or | ||
additions to the Avalanche Authorized Platform, which may expand or modify | ||
usage of the Licensed Software. Upon such announcement, the Avalanche | ||
Authorized Platform will be deemed to be the then-current iteration of such | ||
platform. | ||
|
||
You hereby acknowledge and agree to the terms set forth at | ||
www.avalabs.org/important-notice. | ||
|
||
If you use the Licensed Software in violation of this License, this License | ||
will automatically terminate and Ava Labs reserves all rights to seek any | ||
remedy for such violation. | ||
|
||
Except for uses explicitly permitted in this License, Ava Labs retains all | ||
rights in the Licensed Software, including without limitation the ability to | ||
modify it. | ||
|
||
Except as required or explicitly permitted by this License, you will not use | ||
any Ava Labs names, logos, or trademarks without Ava Labs’ prior written | ||
consent. | ||
|
||
You may use this License for software other than the “Licensed Software” | ||
specified above, as long as the only change to this License is the definition | ||
of the term “Licensed Software.” | ||
|
||
The Licensed Software may reference third party components. You acknowledge | ||
and agree that these third party components may be governed by a separate | ||
license or terms and that you will comply with them. | ||
|
||
**TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE LICENSED SOFTWARE IS PROVIDED | ||
ON AN “AS IS” BASIS, AND AVA LABS EXPRESSLY DISCLAIMS AND EXCLUDES ALL | ||
REPRESENTATIONS, WARRANTIES AND OTHER TERMS AND CONDITIONS, WHETHER EXPRESS OR | ||
IMPLIED, INCLUDING WITHOUT LIMITATION BY OPERATION OF LAW OR BY CUSTOM, | ||
STATUTE OR OTHERWISE, AND INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY, | ||
TERM, OR CONDITION OF NON-INFRINGEMENT, MERCHANTABILITY, TITLE, OR FITNESS FOR | ||
PARTICULAR PURPOSE. YOU USE THE LICENSED SOFTWARE AT YOUR OWN RISK. AVA LABS | ||
EXPRESSLY DISCLAIMS ALL LIABILITY (INCLUDING FOR ALL DIRECT, CONSEQUENTIAL OR | ||
OTHER DAMAGES OR LOSSES) RELATED TO ANY USE OF THE LICENSED SOFTWARE.** |
Oops, something went wrong.