Skip to content

Commit

Permalink
feat(v3): hyperlane core implementation (#45)
Browse files Browse the repository at this point in the history
* cleanup hooks

* remove "Owned"

* organize interfaec

* generic router

* router -> route

* support custom query

* one file contract

* avoid duplication

* ownable

* pausable

* useful kids

* rename methods

* apply to routing-hook

* cleanup

* define hook interface

* typo

* warp: fix error temp

* feat: add conn

* feat: deprecate hub

* hook: typo

* igp: cleanup

* new ism types

* rename event & method

* deprecate hub

* feat: add package prefix

* feat: add package prefix (2)

* test: ownable

* test: pausable

* fix(ownable): use Ownable class as possible

* feat: add pausable alias into workspace

* feat: add `wrap` method to easy to call

* fix: remove `Binary` usage

* feat: v3 mailbox

* fix(mailbox): use contract_querier

* fix(va): compile error

* fix!(va): not to use Binary

* fix!: not to use `Binary`

* refactor(va): merge tests

* chore(mailbox): make public & prune imports

* fix(va): use 'hrp'

* feat: gen schema in build time

* chore(router): move test

* chore(va): redundant

* chore: use event_to_resp

* fix(router): remove Default

* feat: share `to_binary`

* feat: wrap method for `QuoteDispatchMsg`

* fix: export message directly

* feat(hook): implement routing hook

* feat(hook): add schema build script

* feat(hook): add mailbox

* feat(hook): apply mailbox rbac

* fix(ownable): use ensure

* feat(hook): implement all

* remove migrate msg

* fix(hook): revive quote dispatch

* fix(hook): apply quote dispatch msg

* fix: suggestions

* feat: igp interface helper

* feat(igp): schema builder

* feat(igp): v3 igp-core - wip (1)

* chore(hook): visibility

* feat(hook): custom, fallback routing hook

* feat(hook): custom, fallback routing hook interface

* feat(igp): wip - 2

* refactor(igp): simplify package name

* fix(igp): no compile error

* fix(igp): broken

* feat(ism): multisig - wip 1

* fix(igp): oracle test

* chore: pausable test

* fix(ism): routing test

* refactor(warp): cleanup interface

* feat(warp): wip 2

* feat(warp): native

* feat(warp): generic token option

* feat(warp): cw20

* fix: buildable

* test(core): mailbox

* fix: duplicated

* fix(schema): all in one

* chore: schema command

* test(core): mailbox - 2

* test(core): va - 1

* feat: move crypto things to types

* deps: correct package alias

* fix!: remove `untagged`

* test(core): va - done

* fix!: untagged sideeffects

* feat(core): add required hook

* feat(core): query required hook

* fix(router): check owner

* test(hook): merkle

* test(hook): pausable

* feat(hook): default paused field

* chore(hook): derive Default

* test: overflow

* test: redundant fmt

* fix(warp): clippy suggestions

* test(warp): native - 1

* test(core): required hook

* test(hook): routing

* feat!!!: bump v0.0.2

* test: schema tester

* test(hook): add default test

* test(hook): using macro

* fix(mock): using gas_token

* feat(igp): add dest_domain field

* test(hook): routing custom hook

* feat(igp): add mailbox

* chore: build-dev before check

* chore: clean

* test(igp): rstest

* test(igp): add features

* test(igp): add get beneficiary

* feat: verisoning

* feat!(ism): unify interface

* ism schema

* fix!: mailbox query

* fix: add get_nonce function to mailbox contract (#46)

* feat: add get_nonce function to mailbox

* remove bind

---------

Co-authored-by: byeongsu-hong <[email protected]>

* test(core): add init test

* test(core): remove 'revised'

* docs: add deploy sequence

* test: add test executor

* fix(core): typo

* test(mock): use expected interface

* test: update contract list

* test(mock): use uosmo denom

* fix(core): check insufficient amount

* fix(core): dispatch / process

* chore: local dependency

* feat(ism): add expected ism query msg

* fix(ism): convention

* feat(core): add quote gas query

* fix(e2e): wip

* fix(warp): correct comment

Co-authored-by: Yorke Rhodes <[email protected]>

* fix(core): hook metadata feature

* feat(hook): add aggregate - wip

* feat(ism): aggregate ism

* feat: aggregate for ism

* test(warp): fixed tests

* pnpm install

* feat: deploy scripts - wip

* fix(core): gas policy - peer review needed

* fix(core): clippy

* feat(hook): aggregate - wip

* feat: deployer

* feat(hook): add index field

* test: add schema test for mock contract

* feat: warp deployer

* test(hook): assert event attribute

* test: fixtures

* test(e2e): fix deployer

* fix(hook): separate event

* fix(hook): revive attr

* fix: cw e2e deployer

* token warp deployer and linker

* feat: wip script

* fix(core): code review

* fix: verify income message with latest dispatched id

* feat: public pausable hook

* fix(hook): make routing hooks public

* fix(ism): use message id multisig

* v0.0.6-rc1

* fix: duplicated owner assertion

* chore: polishing

* feat: apply new metadata structure

* fix(hook): use prev index

* fix(ism): new metadata

* test: working?

* fix: working

* chore: remove redundant debug

* fix: correct query

* revert: aggregate

* fix: metadata - wip

* test: disable unit tests for warp route

* chore: clippy

---------

Co-authored-by: Eric <[email protected]>
Co-authored-by: Yorke Rhodes <[email protected]>
  • Loading branch information
3 people authored Oct 17, 2023
1 parent 2a4e694 commit 7dd4265
Show file tree
Hide file tree
Showing 220 changed files with 10,018 additions and 7,505 deletions.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
all-test = "test --workspace"
schema = "run --bin schema"
schema = "run --package hpl-schema --bin hpl-schema"

[env]
RUSTFLAGS = "-C link-arg=-s"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
debug/
target/

schema
**/*/schema
!packages/schema

# Generated by rust-optimizer
artifacts/
Expand Down
23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ panic = "abort"
rpath = false

[workspace.package]
version = "0.0.1"
version = "0.0.6-rc1"
authors = [
"byeongsu-hong <[email protected]>",
"Eric <[email protected]>",
Expand Down Expand Up @@ -84,27 +84,32 @@ cw-multi-test = "0.17.0"
rstest = "0.18.2"
test-tube = { version = "0.1.7" }
osmosis-test-tube = { version = "19.2.0" }
ibcx-test-utils = { version = "0.1.2" }

tokio = { version = "1", features = ["full"] }
ethers = "2.0.7"

# workspace aliases (./contracts)
hpl-hub = { path = "./contracts/core/hub" }
hpl-mailbox = { path = "./contracts/core/mailbox" }
hpl-validator-announce = { path = "./contracts/core/va" }

hpl-default-hook = { path = './contracts/hooks/default-hook' }
hpl-domain-routing-hook = { path = "./contracts/hooks/domain-routing-hook" }
hpl-hook-merkle = { path = "./contracts/hooks/merkle" }
hpl-hook-pausable = { path = "./contracts/hooks/pausable" }
hpl-hook-routing = { path = "./contracts/hooks/routing" }
hpl-hook-routing-custom = { path = "./contracts/hooks/routing-custom" }
hpl-hook-routing-fallback = { path = "./contracts/hooks/routing-fallback" }

hpl-igp-core = { path = "./contracts/igps/core" }
hpl-igp-gas-oracle = { path = "./contracts/igps/gas-oracle" }
hpl-igp = { path = "./contracts/igps/core" }
hpl-igp-oracle = { path = "./contracts/igps/oracle" }

hpl-ism-multisig = { path = "./contracts/isms/multisig" }
hpl-ism-routing = { path = "./contracts/isms/routing" }

hpl-token-cw20 = { path = "./contracts/warp/cw20" }
hpl-token-native = { path = "./contracts/warp/native" }
hpl-warp-cw20 = { path = "./contracts/warp/cw20" }
hpl-warp-native = { path = "./contracts/warp/native" }

# workspace aliases (./packages)
hpl-router = { path = "./packages/router" }
hpl-ownable = { path = "./packages/ownable" }
hpl-pausable = { path = "./packages/pausable" }
hpl-router = { path = "./packages/router" }
hpl-interface = { path = "./packages/interface" }
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@

clean:
@cargo clean
@rm -rf ./artifacts

schema:
ls ./contracts | xargs -n 1 -t beaker wasm ts-gen

build:
cargo wasm

build-dev:
build-dev: clean
cargo cw-optimizoor

check:
check: build-dev
ls -d ./artifacts/*.wasm | xargs -I x cosmwasm-check x
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
# cw-hyperlane

[![codecov](https://codecov.io/gh/many-things/cw-hyperlane/branch/main/graph/badge.svg?token=SGYE7FBTAO)](https://codecov.io/gh/many-things/cw-hyperlane)

> This project is under active development...!
## Deploy Sequence

1. Deploy [Mailbox](./contracts/core/mailbox)

2. Deploy [Validator Announce](./contracts/core/va)

3. Deploy hooks to use with Mailbox (default hook, required hook)

- [interchain gas paymaster (IGP)](./contracts/igps/core)

- [IGP oracle](./contracts/igps/oracle)

- [merkle](./contracts/hooks/merkle)

- [pausable](./contracts/hooks/pausable)

- [domain routing](./contracts/hooks/routing)

- [domain routing custom](./contracts/hooks/routing-custom)

- [domain routing fallback](./contracts/hooks/routing-fallback)

- For testing: [mock hook](./contracts/mocks/mock-hook)

4. Deploy isms to use with Mailbox (defualt ism)

- [multisig ism](./contracts/isms/multisig)

- [routing ism](./contracts/isms/routing)

- [aggregate ism](./contracts/isms/aggregate)

- For testing: [mock ism](./contracts/mocks/mock-ism)

5. Set deployed hooks and isms to Mailbox

6. Deployment for core protocol is done! You can deploy some contracts on the top.
18 changes: 0 additions & 18 deletions contracts/core/hub/src/bin/schema.rs

This file was deleted.

85 changes: 0 additions & 85 deletions contracts/core/hub/src/contract.rs

This file was deleted.

5 changes: 0 additions & 5 deletions contracts/core/hub/src/event.rs

This file was deleted.

10 changes: 0 additions & 10 deletions contracts/core/hub/src/lib.rs

This file was deleted.

7 changes: 0 additions & 7 deletions contracts/core/hub/src/state.rs

This file was deleted.

7 changes: 7 additions & 0 deletions contracts/core/mailbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,22 @@ cosmwasm-schema.workspace = true

cw-storage-plus.workspace = true
cw2.workspace = true
cw-utils.workspace = true

serde.workspace = true
schemars.workspace = true
bech32.workspace = true

thiserror.workspace = true

hpl-ownable.workspace = true
hpl-pausable.workspace = true
hpl-interface.workspace = true

[dev-dependencies]
rstest.workspace = true

serde.workspace = true

cw-multi-test.workspace = true
ibcx-test-utils.workspace = true
18 changes: 0 additions & 18 deletions contracts/core/mailbox/src/bin/schema.rs

This file was deleted.

Loading

0 comments on commit 7dd4265

Please sign in to comment.