-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ron/transact-from-eth-to-sub
- Loading branch information
Showing
103 changed files
with
18,767 additions
and
3,954 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,61 @@ | ||
name: npm-publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: snowbridge-runner | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Build Contracts | ||
working-directory: contracts | ||
run: | | ||
forge build | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: Build Contract Types | ||
working-directory: web/packages/contract-types | ||
run: | | ||
pnpm install | ||
pnpm typechain | ||
pnpm build | ||
- name: Build API | ||
working-directory: web/packages/api | ||
run: | | ||
pnpm install | ||
pnpm build | ||
- name: Publish Contract Types | ||
working-directory: web/packages/contract-types | ||
run: | | ||
pnpm publish | ||
- name: Publish API | ||
working-directory: web/packages/api | ||
run: | | ||
pnpm publish | ||
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,39 @@ | ||
name: relayer | ||
|
||
on: | ||
push: | ||
paths: | ||
- "relayer/**" | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "relayer/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: snowbridge-runner | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: setup go | ||
uses: actions/checkout@v4 | ||
with: | ||
go-version: '^1.20.1' | ||
|
||
- name: check go version | ||
run: go version | ||
|
||
- name: install dependencies | ||
working-directory: relayer | ||
run: go mod download | ||
|
||
- name: Add gopath to bin | ||
run: echo "$HOME/go/bin" >> $GITHUB_PATH | ||
|
||
- name: test | ||
working-directory: relayer | ||
run: go test -v ./... |
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
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
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
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
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
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,33 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.23; | ||
|
||
import "../../Gateway.sol"; | ||
|
||
import {UD60x18, convert} from "prb/math/src/UD60x18.sol"; | ||
import {PricingStorage} from "../../storage/PricingStorage.sol"; | ||
|
||
contract GatewayV2 is Gateway { | ||
constructor( | ||
address beefyClient, | ||
address agentExecutor, | ||
ParaID bridgeHubParaID, | ||
bytes32 bridgeHubAgentID, | ||
uint8 foreignTokenDecimals | ||
) Gateway(beefyClient, agentExecutor, bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals) {} | ||
|
||
function initialize(bytes memory data) external override { | ||
// Prevent initialization of storage in implementation contract | ||
if (ERC1967.load() == address(0)) { | ||
revert Unauthorized(); | ||
} | ||
|
||
PricingStorage.Layout storage pricing = PricingStorage.layout(); | ||
|
||
if (pricing.multiplier != convert(0)) { | ||
revert AlreadyInitialized(); | ||
} | ||
|
||
pricing.multiplier = abi.decode(data, (UD60x18)); | ||
} | ||
} |
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
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
Oops, something went wrong.