Merged
Conversation
jhelison
reviewed
Jul 2, 2025
Comment on lines
+1
to
+24
| from common import get_key_address | ||
|
|
||
| ############################# | ||
| # Core Deployment Variables # | ||
| ############################# | ||
|
|
||
| # Deployment | ||
| OWNER_KEY_NAME = "rwa" | ||
| OWNER_KEY_ADDRESS = get_key_address(OWNER_KEY_NAME) | ||
| CONTRACTS = { | ||
| "owner_roles_address": "kii1hez8n9mnljtca28xrg4a54p4cdharlsg0vku0008ng64ldgfapdqsqctag", | ||
| "agent_roles_address": "kii14tzdqsgsdfcgxy0zu2vqcaj347lv5xpelpadusrspnkxddc53fhq9vc0h8", | ||
| "trusted_issuers_address": "kii17xsl3q2p3elhh747r3ttn08j2p95jsd3c7rfmuc5rws5a20u9kqqrrx0nd", | ||
| "claim_topics_address": "kii17k6uthn6ymd3ta25glx6qpa2sfz2hkt5a22lynzdm7xgk7kklckqc4gytm", | ||
| "on_chain_id_address": "kii1y8s38zn7ry7xc95ej2z08eq520y4v9qdsysfgkfwelhh635e4t2qq8xxp5", | ||
| "compliance_registry_address": "kii1dpws8lmu2l4awdau6zhezxm97tshu427aulr2xwp7uarpd8jqu7srjz2gm", | ||
| "compliance_claims_address": "kii12n3frtnx8mh2vpvzk7mqkr6yqkfe77339c7uakzqqa4pv46zdr9qt020h3", | ||
| "compliance_country_restriction_address": "kii1k4j6gr75k23tvqjdw9zvtrdxh7pxtexy5pdk7xjmwf385msx75fsz470kz", | ||
| "cw20_base_address": "kii1zvjy36ysunq56dhgyxggp5gwrymxjs95twj5lgcpqujftppn739s83aym4", | ||
| } | ||
|
|
||
| # Management | ||
| TRUSTED_ISSUER_KEY_NAME = "trusted_issuer" | ||
| TRUSTED_ISSUER_KEY_ADDRESS = get_key_address(TRUSTED_ISSUER_KEY_NAME) |
Collaborator
There was a problem hiding this comment.
I was thinking that it would be a real config file xD
Comment on lines
+128
to
+146
| # CW20 base for test token | ||
| print("Deploying CW20 Base contract...") | ||
| cw20_base = store_contract("artifacts/cw20_base.wasm", KEY_NAME) | ||
| print(f"CW20 Base stored with code ID {cw20_base}") | ||
| cw20_base_init_msg = { | ||
| "token_info": { | ||
| "name": "Test Token", | ||
| "symbol": "TEST", | ||
| "decimals": 6, | ||
| "initial_balances": [{"address": KEY_ADDRESS, "amount": "1000000"}], | ||
| }, | ||
| "registries": { | ||
| "compliance_address": compliance_registry_address, | ||
| }, | ||
| } | ||
| cw20_base_address = instantiate_contract( | ||
| cw20_base, cw20_base_init_msg, "CW20Base", KEY_NAME | ||
| ) | ||
| print(f"CW20 Base contract instantiated at {cw20_base_address}") |
Collaborator
There was a problem hiding this comment.
We should have a RWA token configurator to prepare new tokens we want to release.
We can probably pass a json as argument where we fill all the information and then python applies the heavy lifting
Comment on lines
+193
to
+214
| # Query contract queries a contract with the given query message | ||
| def query_contract(contract_address, query_msg): | ||
| # Build the command to query the contract | ||
| cmd = [ | ||
| KIICHAIN, | ||
| "query", | ||
| "wasm", | ||
| "contract-state", | ||
| "smart", | ||
| contract_address, | ||
| json.dumps(query_msg), | ||
| "--node", RPC_URL, | ||
| "-o", "json" | ||
| ] | ||
|
|
||
| # Run the command | ||
| result, err = run_cmd(cmd) | ||
| if err: | ||
| raise Exception(f"Failed to query contract: {err}") | ||
|
|
||
| # Parse and return the result | ||
| return json.loads(result) |
Collaborator
There was a problem hiding this comment.
I was not expecting queries to error out, but your suggestion on applying the expected error is nice. I ways like to have a good control on errors. So we can probably match the if error is really the expected error by checking for a substring that could be raised.
Contributor
Author
There was a problem hiding this comment.
Added a query that tries to match error
jhelison
approved these changes
Jul 2, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reviews contract and checks utilities so we can better understand it. Document discoveries.