From e326725aeaf8ef01320850086cc19d5a7b356fc7 Mon Sep 17 00:00:00 2001 From: Spoorthi Satheesha <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:50:21 +0000 Subject: [PATCH 1/4] Create CHANGELOG.md --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..790bab3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog + +All notable changes to this project will be documented in this file. + + + +## Unreleased + +### Added + +- Initial implementation of AutoCCTP middleware +- [#5](https://github.com/noble-assets/autocctp/pull/5) - Bumping to latest ibc-go v8 \ No newline at end of file From 626044400ba9a84f656fbd6db314232bc02812c3 Mon Sep 17 00:00:00 2001 From: Spoorthi Satheesha <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:54:17 +0000 Subject: [PATCH 2/4] force changelog update on every PR --- .github/workflows/changelog.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/changelog.yaml diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml new file mode 100644 index 0000000..fd49c9e --- /dev/null +++ b/.github/workflows/changelog.yaml @@ -0,0 +1,10 @@ +name: "Ensure changelog updates" +on: + pull_request: + branches: [main] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - uses: dangoslen/changelog-enforcer@v3 \ No newline at end of file From 7d72552793bf7421de00d8f26c2f86af25866a67 Mon Sep 17 00:00:00 2001 From: Spoorthi Satheesha <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:52:23 +0000 Subject: [PATCH 3/4] Create README.md --- README.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..212e3b5 --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +# AutoCCTP + +AutoCCTP is an IBC Middleware which allows a user to send funds from an IBC connected chain using the ICS20 protocol, to a non-Cosmos CCTP domain, via the Noble chain. + +The middleware has a strong dependency on CCTP module and expects a specific format of the ICS20 memo field populated with CCTP Deposit parameters to be filled. + +## How to use? + +ICS20 transfer destination address on the Noble chain needs to be the module address of the `autocctp` module. This value can be obtained by running + +```sh +nobled q auth module-account autocctp +# or +curl {rest-api-server}/cosmos/auth/v1beta1/module_accounts/autocctp +``` + +The current module addresses are: +| Network | Chain ID | Address | +| ------- | -------- | ------- | +| Mainnet | noble-1 | //todo | +| Testnet | grand-1 | //todo | + +ICS20 transfer incoming from counterparty chain needs to populate the ICS20 memo field with following json message: + +1. Forward entire ICS20 transfer amount to the destination domain + +```jsonc +{ + "deposit_for_burn": { + "destination_domain": 0, + "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=" + } +} +``` + +2. Forward only the specified amount to the destination domain + +The specified amount needs to be less than the ICS20 transfer amount. The difference is paid as fees to the specified fee recipient. + +> **Note** +> If Fee Recipient is specified, the amount value needs to be specified as well. + +```jsonc +{ + "deposit_for_burn": { + "destination_domain": 0, + "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", + "amount": "100", + "fee_recipient": "noble1qe8uuf5x69c526h4nzxwv4ltftr73v7qgk33qz" + } +} +``` + +3. Forward entire ICS20 transfer amount to the destination domain with destination caller + +```jsonc +{ + "deposit_for_burn_with_caller": { + "destination_domain": 0, + "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", + "destination_caller": "T6iiTX0dDAj20/FvjjtLKCjtLcy5XQ4dTO6NFHPaG1U=" + } +} +``` + +4. Forward only the specified amount to the destination domain with destination caller + +The specified amount needs to be less than the ICS20 transfer amount. The difference is paid as fees to the specified fee recipient. + +> **Note** +> If Fee Recipient is specified, the amount value needs to be specified as well. + +```jsonc +{ + "deposit_for_burn_with_caller": { + "destination_domain": 0, + "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", + "amount": "100", + "fee_recipient": "noble1qe8uuf5x69c526h4nzxwv4ltftr73v7qgk33qz", + "destination_caller": "T6iiTX0dDAj20/FvjjtLKCjtLcy5XQ4dTO6NFHPaG1U=" + } +} +``` \ No newline at end of file From 09f9de8dae95e965c03dd2f5987ac0ce18f3130f Mon Sep 17 00:00:00 2001 From: Spoorthi Satheesha <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:08:53 +0000 Subject: [PATCH 4/4] adding details about the various parameters in the memo --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 212e3b5..f9fc7c0 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ The middleware has a strong dependency on CCTP module and expects a specific for ## How to use? -ICS20 transfer destination address on the Noble chain needs to be the module address of the `autocctp` module. This value can be obtained by running +ICS20 transfer destination address needs to be the module address of the `autocctp` module. For any other address, autocctp is not possible. This value can be obtained by running ```sh nobled q auth module-account autocctp # or -curl {rest-api-server}/cosmos/auth/v1beta1/module_accounts/autocctp +curl {rest-api-url}/cosmos/auth/v1beta1/module_accounts/autocctp ``` The current module addresses are: @@ -20,14 +20,24 @@ The current module addresses are: | Mainnet | noble-1 | //todo | | Testnet | grand-1 | //todo | -ICS20 transfer incoming from counterparty chain needs to populate the ICS20 memo field with following json message: +ICS20 transfer incoming from counterparty chain needs to populate the ICS20 memo field with following information: + +1. **Destination Domain** - Circle issued identifier for different blockchains. Values for this field can be found [here](https://developers.circle.com/stablecoins/supported-domains). +2. **Mint Recipient** - Address of the recipient on the Destination Domain +3. **Fee Recipient** (optional) - A bech32 encoded address on Noble which will receive the transfer fees. If this value is specified, Amount also needs to be specified. +4. **Amount** (optional) - Number denoting the amount which should be forwarded to the Destination Domain. Should be less than ICS20 transfer amount. The difference will be sent to Fee Recipient. +5. **Destination Caller** (optional) - Caller on destination domain + +The response acknowledgement includes the Deposit Nonce in case of success, and error message in case of failure. If the autocctp forwarding fails, the entire ICS20 transfer fails and the funds are avaliable back on the counterparty chain. + +### Examples 1. Forward entire ICS20 transfer amount to the destination domain ```jsonc { "deposit_for_burn": { - "destination_domain": 0, + "destination_domain": 5, "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=" } } @@ -35,17 +45,12 @@ ICS20 transfer incoming from counterparty chain needs to populate the ICS20 memo 2. Forward only the specified amount to the destination domain -The specified amount needs to be less than the ICS20 transfer amount. The difference is paid as fees to the specified fee recipient. - -> **Note** -> If Fee Recipient is specified, the amount value needs to be specified as well. - ```jsonc { "deposit_for_burn": { - "destination_domain": 0, + "destination_domain": 5, "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", - "amount": "100", + "amount": "99", "fee_recipient": "noble1qe8uuf5x69c526h4nzxwv4ltftr73v7qgk33qz" } } @@ -56,7 +61,7 @@ The specified amount needs to be less than the ICS20 transfer amount. The differ ```jsonc { "deposit_for_burn_with_caller": { - "destination_domain": 0, + "destination_domain": 5, "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", "destination_caller": "T6iiTX0dDAj20/FvjjtLKCjtLcy5XQ4dTO6NFHPaG1U=" } @@ -65,15 +70,10 @@ The specified amount needs to be less than the ICS20 transfer amount. The differ 4. Forward only the specified amount to the destination domain with destination caller -The specified amount needs to be less than the ICS20 transfer amount. The difference is paid as fees to the specified fee recipient. - -> **Note** -> If Fee Recipient is specified, the amount value needs to be specified as well. - ```jsonc { "deposit_for_burn_with_caller": { - "destination_domain": 0, + "destination_domain": 5, "mint_recipient": "MLqOfAGMXKGrGr0LNjV8xjpJALM3zZB/GDVgGqlEjcU=", "amount": "100", "fee_recipient": "noble1qe8uuf5x69c526h4nzxwv4ltftr73v7qgk33qz",