Repository navigation
[FEAT]: land SafHandle v1 contract, tests, tooling - #4
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (54)
📝 WalkthroughWalkthroughThis PR adds the SafHandle CosmWasm contract crate implementing short-name ( ChangesSafHandle contract implementation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Contract as SafHandle Contract
participant NAMES as NAMES Store
participant OWNER_NAMES as OWNER_NAMES Index
participant Bank as BankMsg
User->>Contract: execute(RegisterName{name})
Contract->>Contract: normalize_name(name)
Contract->>Contract: check reserved / not taken
Contract->>OWNER_NAMES: check sender does not already own a name
Contract->>Contract: assert_exact_fee(info, denom, fee)
Contract->>NAMES: save NameRecord{owner}
Contract->>OWNER_NAMES: save sender -> name
Contract->>Bank: fee_payout to dev_module_wallet
Contract-->>User: Response(attributes, fee payout msg)
sequenceDiagram
participant User
participant Contract as SafHandle Contract (phone feature)
participant PHONES as PHONES Store
participant OWNER_PHONES as OWNER_PHONES Index
participant Verifier as Governance/Verifier
User->>Contract: execute(LinkPhone{phone})
Contract->>Contract: validate_phone(phone)
Contract->>PHONES: check phone not taken
Contract->>OWNER_PHONES: check sender does not already own phone
Contract->>Contract: assert_exact_fee(info, denom, phone_link_fee)
Contract->>PHONES: save PhoneRecord{owner, verified=false}
Contract->>OWNER_PHONES: save sender -> phone
Contract-->>User: Response(attributes, fee payout msg)
Verifier->>Contract: execute(MarkPhoneVerified{phone})
Contract->>Contract: authorize governance_admin or VERIFIERS
Contract->>PHONES: load PhoneRecord
Contract->>PHONES: update verified=true, verified_at_time
Contract-->>Verifier: Response(verified attributes)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
contracts/safhandle/): register / transfer /release short names, read queries (
get_address,resolve_name,name_record,handles,config), governance (update_config), with exact-fee enforcement and contract-side namevalidation/normalization. Phone linking ships behind the
phoneCargo feature (Phase 2, off by default).cw-multi-testintegration tests, generated JSON schema, and testnet deployment tooling(
scripts/deploy-testnet.sh,config/).Why
testnet-deployed v1 contract. No linked issue.
Type of change
Test plan
npm run verifypasses locallycontracts/safhandle/tests/integration.rs) + unit tests insrc/safro-testnet-1— v1 deployed and live on testnet (see README status)Steps:
cargo test --workspacenpm run verifySecurity checklist
deploy-testnet.shreferences a keyring key name onlyFEES_AND_GOVERNANCE.md— exact-fee enforcement anddev_module_walletroutingDocumentation
README.mdordocs/updated — full docs; CLI guide and deploy script now in EnglishCHANGELOG.mdupdated — documented under[1.0.0](this PR is the v1.0.0 landing)Summary by CodeRabbit
New Features
Bug Fixes
Documentation