Skip to content

Conversation

@Thaleszh
Copy link
Contributor

Description

Reviews contract and checks utilities so we can better understand it. Document discoveries.

Copy link

@kalamkhan114 kalamkhan114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull request

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that it would be a real config file xD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x)

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}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a query that tries to match error

@Thaleszh Thaleszh merged commit 2c81a40 into main Jul 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants