Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat-token-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Sep 13, 2024
2 parents 4a9f443 + ff3d79b commit 45c77b7
Show file tree
Hide file tree
Showing 8 changed files with 982 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/label-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Label PRs for feat-token-extensions

on:
pull_request:
branches:
- feat-token-extensions

jobs:
tag-and-label:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up GitHub CLI
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install GitHub CLI
run: |
npm install -g @actions/github-script
- name: Add label to PR
uses: actions/github-script@v7
with:
script: |
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['feat-token-extensions']
})
- name: Add Tag to PR Title
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "feat-token-extensions"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scripts/node_modules
scripts/.env
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,23 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!


## 🪛 Deployment

This section details the steps to deploy Hyperlane contracts on Starknet. Note that the deployment script will set a basic configuration for all the required contracts. Further configuration process might be required based on the use case. Constructors parameters can be specified in the `contract_config.json`.
Firstly, set the following environment variables, important for the deployment process:
```bash
STARKNET_RPC_URL=
ACCOUNT_ADDRESS=
BENEFICIARY_ADDRESS=
NETWORK=
PRIVATE_KEY=
```
The beneficiary address is the account that will be used to recover funds from the protocol fee.
Once set, the contracts can be deployed using this command( assuming `ts-node` is installed):

```bash
ts-node deploy.ts
```
5 changes: 5 additions & 0 deletions scripts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
STARKNET_RPC_URL=
ACCOUNT_ADDRESS=
BENEFICIARY_ADDRESS=
NETWORK=
PRIVATE_KEY=
216 changes: 216 additions & 0 deletions scripts/contract_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"contracts": {
"merkleroot_multisig_ism": {
"name": "merkleroot_multisig_ism",
"constructor": {
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"validators": {
"type": "Span<felt252>",
"value": [
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
},
"threshold": {
"type": "u32",
"value": "1"
}
}
},
"protocol_fee": {
"name": "protocol_fee",
"constructor": {
"max_protocol_fee_low": {
"type": "u128",
"value": "1000000000000000000"
},
"max_protocol_fee_high": {
"type": "u128",
"value": "0"
},
"protocol_fee_low": {
"type": "u128",
"value": "10000000000000000"
},
"protocol_fee_high": {
"type": "u128",
"value": "0"
},
"beneficiary": {
"type": "ContractAddress",
"value": "$BENEFICIARY_ADDRESS"
},
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"token_address": {
"type": "ContractAddress",
"value": "0x049D36570D4e46f48e99674bd3fcc84644DdD6b96F7C741B1562B82f9e004dC7"
}
}
},
"merkle_tree_hook" : {
"name": "merkle_tree_hook",
"constructor": {
"mailbox": {
"type": "ContractAddress",
"value": "$mailbox"
},
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
}
}
},
"noop_ism": {
"name": "noop_ism",
"constructor": {

}
},
"hook": {
"name": "hook",
"constructor": {

}
},
"pausable_ism": {
"name": "pausable_ism",
"constructor": {
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
}
}
},
"trusted_relayer_ism": {
"name": "trusted_relayer_ism",
"constructor": {
"mailbox":{
"type": "ContractAddress",
"value": "$mailbox"
},
"trusted_relayer": {
"type": "ContractAddress",
"value": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
}
},
"mailbox": {
"name": "mailbox",
"constructor": {
"local_domain": {
"type": "u32",
"value": "100"
},
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"default_ism": {
"type": "ContractAddress",
"value": "$merkleroot_multisig_ism"
},
"default_hook":{
"type": "ContractAddress",
"value": "$hook"
},
"required_hook": {
"type": "ContractAddress",
"value": "$protocol_fee"
}
}
},
"validator_announce": {
"name": "validator_announce",
"constructor": {
"mailbox": {
"type": "ContractAddress",
"value": "$mailbox"
},
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
}
}
},
"aggregation": {
"name": "aggregation",
"constructor": {
"owner":{
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"modules": {
"type": "Span<felt252>",
"value": [
"0x0000000000000000000000000000000000000000000000000000000000000002"
]
},
"threshold": {
"type": "u32",
"value": "1"
}
}
},
"messageid_multisig_ism": {
"name": "messageid_multisig_ism",
"constructor": {
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"validators": {
"type": "Span<felt252>",
"value": [
"0x0000000000000000000000000000000000000000000000000000000000000003"
]
},
"threshold": {
"type": "u32",
"value": "1"
}
}
},
"default_fallback_routing_ism": {
"name": "default_fallback_routing_ism",
"constructor": {
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
},
"mailbox": {
"type": "ContractAddress",
"value": "$mailbox"
}
}
},
"domain_routing_ism": {
"name": "domain_routing_ism",
"constructor": {
"owner": {
"type": "ContractAddress",
"value": "$OWNER_ADDRESS"
}
}
}
},
"deploymentOrder": [
"merkleroot_multisig_ism",
"messageid_multisig_ism",
"domain_routing_ism",
"noop_ism",
"pausable_ism",
"aggregation",
"protocol_fee",
"hook",
"mailbox",
"merkle_tree_hook",
"default_fallback_routing_ism",
"trusted_relayer_ism",
"validator_announce"
]
}
Loading

0 comments on commit 45c77b7

Please sign in to comment.