Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion contracts/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ sp-core = { version = "34.0.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-runtime = { version = "39.0.0", default-features = false }

# Pin transitive deps to versions compatible with rustc 1.85.0
# Direct optional pins steer cargo-contract resolution to versions compatible with rustc 1.85.0
# without enabling these crates in no_std contract builds.
time = { version = ">=0.3.0, <0.3.37", default-features = false, optional = true }
substrate-bip39 = { version = "=0.6.0", default-features = false, optional = true }

[dev-dependencies]
ink_e2e = { version = "5.1.1" }
Expand Down
131 changes: 65 additions & 66 deletions contracts/bridge/integration-tests/.papi/contracts/bridge.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"source": {
"hash": "0xdb4c9dcad6cd05baff5d20e42c067d914483023f2da3da65919170607aba8346",
"hash": "0x569380f6a3c38b039008e032991a7c891ad6c9c043014d4fe9d5b087d20d6c02",
"language": "ink! 5.1.1",
"compiler": "rustc 1.85.0",
"build_info": {
"build_mode": "Debug",
"build_mode": "Release",
"cargo_contract_version": "5.0.3",
"rust_toolchain": "stable-aarch64-apple-darwin",
"wasm_opt_settings": {
Expand Down Expand Up @@ -118,37 +118,13 @@
"events": [
{
"args": [
{
"docs": [],
"indexed": true,
"label": "chain_id",
"type": {
"displayName": [
"ChainId"
],
"type": 3
}
},
{
"docs": [],
"indexed": false,
"label": "escrow_contract",
"type": {
"displayName": [
"ink",
"primitives",
"AccountId"
],
"type": 0
}
},
{
"docs": [],
"indexed": false,
"label": "deposit_nonce",
"type": {
"displayName": [
"DepositNonce"
"Nonce"
],
"type": 6
}
Expand All @@ -166,19 +142,6 @@
"type": 0
}
},
{
"docs": [],
"indexed": true,
"label": "recipient",
"type": {
"displayName": [
"ink",
"primitives",
"AccountId"
],
"type": 0
}
},
{
"docs": [],
"indexed": false,
Expand All @@ -192,7 +155,7 @@
},
{
"docs": [],
"indexed": false,
"indexed": true,
"label": "deposit_request_id",
"type": {
"displayName": [
Expand All @@ -208,12 +171,13 @@
"**Guardian Action Required**: Monitor this event on Bittensor chain.",
"When seen, call attest_deposit on Hippius pallet with:",
"- request_id: deposit_request_id from this event",
"- recipient: recipient from this event",
"- amount: amount from this event (alphaRao converted to halphaRao)"
"- recipient: sender from this event (sender == recipient)",
"- amount: amount from this event (alphaRao converted to halphaRao)",
"- nonce: deposit_nonce from this event"
],
"label": "DepositRequestCreated",
"module_path": "bridge::events",
"signature_topic": "0x739f750c8fc30427bf8e06588886b81420e42526df0bb35290671717d64680d8"
"signature_topic": "0xb379fe936c523c93893917cf8c96a5e497768a23882517aaaf1b7a46a39599f4"
},
{
"args": [
Expand Down Expand Up @@ -807,6 +771,15 @@
],
"type": 6
}
},
{
"label": "nonce",
"type": {
"displayName": [
"Nonce"
],
"type": 6
}
}
],
"default": false,
Expand All @@ -820,7 +793,8 @@
" # Arguments",
" * `request_id` - The withdrawal request ID from Hippius",
" * `recipient` - Recipient to release Alpha to",
" * `amount` - Amount to release (in alphaRao)"
" * `amount` - Amount to release (in alphaRao)",
" * `nonce` - Nonce from the withdrawal request (used for ID verification)"
],
"label": "attest_withdrawal",
"mutates": true,
Expand Down Expand Up @@ -852,7 +826,10 @@
"",
" After calling this, admin should manually release Alpha via admin_manual_release.",
"",
" NOTE: Intentionally does not check pause state — admin must operate during emergencies.",
" # Pause Behavior",
" Intentionally does NOT check pause state. Admin emergency/recovery",
" functions must remain operational when the bridge is paused, since",
" pausing is the first step in incident response.",
"",
" # Arguments",
" * `request_id` - The deposit request ID to fail"
Expand Down Expand Up @@ -903,12 +880,23 @@
"docs": [
" Admin manually releases Alpha to a recipient (for stuck deposits)",
"",
" NOTE: Intentionally does not check pause state — admin must operate during emergencies.",
" # Pause Behavior",
" Intentionally does NOT check pause state. Admin emergency/recovery",
" functions must remain operational when the bridge is paused, since",
" pausing is the first step in incident response.",
"",
" The `deposit_request_id` parameter is intentionally optional and is NOT",
" validated against storage — it exists solely for the audit trail in",
" emitted events. This allows emergency releases even when the deposit",
" request record may be missing or corrupted.",
"",
" This bypass is limited to bridge pause/storage recovery checks. It still",
" refuses to move Alpha that Bittensor reports as conviction-locked.",
"",
" # Arguments",
" * `recipient` - Account to receive Alpha",
" * `amount` - Amount to release (in alphaRao)",
" * `deposit_request_id` - Optional deposit request ID for audit trail"
" * `deposit_request_id` - Optional deposit request ID for audit trail (not validated)"
],
"label": "admin_manual_release",
"mutates": true,
Expand Down Expand Up @@ -947,7 +935,10 @@
"docs": [
" Admin cancels a withdrawal that is stuck",
"",
" NOTE: Intentionally does not check pause state — admin must operate during emergencies.",
" # Pause Behavior",
" Intentionally does NOT check pause state. Admin emergency/recovery",
" functions must remain operational when the bridge is paused, since",
" pausing is the first step in incident response.",
"",
" # Arguments",
" * `request_id` - The withdrawal ID to cancel"
Expand Down Expand Up @@ -1281,7 +1272,7 @@
"label": "nonce",
"type": {
"displayName": [
"DepositNonce"
"Nonce"
],
"type": 6
}
Expand Down Expand Up @@ -1921,7 +1912,7 @@
{
"name": "nonce",
"type": 6,
"typeName": "DepositNonce"
"typeName": "Nonce"
},
{
"name": "hotkey",
Expand Down Expand Up @@ -2336,7 +2327,7 @@
{
"name": "next_deposit_nonce",
"type": 6,
"typeName": "<DepositNonce as::ink::storage::traits::AutoStorableHint<::ink::\nstorage::traits::ManualKey<4139309743u32, ()>,>>::Type"
"typeName": "<Nonce as::ink::storage::traits::AutoStorableHint<::ink::storage\n::traits::ManualKey<4139309743u32, ()>,>>::Type"
},
{
"name": "deposit_requests",
Expand All @@ -2346,7 +2337,7 @@
{
"name": "nonce_to_deposit_request_id",
"type": 16,
"typeName": "<Mapping<DepositNonce, DepositRequestId> as::ink::storage::traits::\nAutoStorableHint<::ink::storage::traits::ManualKey<3491510221u32,\n()>,>>::Type"
"typeName": "<Mapping<Nonce, DepositRequestId> as::ink::storage::traits::\nAutoStorableHint<::ink::storage::traits::ManualKey<3491510221u32,\n()>,>>::Type"
},
{
"name": "withdrawals",
Expand Down Expand Up @@ -2557,55 +2548,55 @@
},
{
"index": 9,
"name": "InvalidWithdrawalDetails"
"name": "InvalidTTL"
},
{
"index": 10,
"name": "InvalidTTL"
"name": "BridgePaused"
},
{
"index": 11,
"name": "BridgePaused"
"name": "DepositRequestNotFound"
},
{
"index": 12,
"name": "DepositRequestNotFound"
"name": "WithdrawalNotFound"
},
{
"index": 13,
"name": "WithdrawalNotFound"
"name": "DepositRequestAlreadyFinalized"
},
{
"index": 14,
"name": "DepositRequestAlreadyFinalized"
"name": "WithdrawalAlreadyFinalized"
},
{
"index": 15,
"name": "WithdrawalAlreadyFinalized"
"name": "Overflow"
},
{
"index": 16,
"name": "Overflow"
"name": "RuntimeCallFailed"
},
{
"index": 17,
"name": "RuntimeCallFailed"
"name": "StakeQueryFailed"
},
{
"index": 18,
"name": "StakeQueryFailed"
"name": "TransferFailed"
},
{
"index": 19,
"name": "TransferFailed"
"name": "StakeConsolidationFailed"
},
{
"index": 20,
"name": "StakeConsolidationFailed"
"name": "CodeUpgradeFailed"
},
{
"index": 21,
"name": "CodeUpgradeFailed"
"name": "InvalidRequestId"
},
{
"index": 22,
Expand All @@ -2614,6 +2605,14 @@
{
"index": 23,
"name": "TTLNotExpired"
},
{
"index": 24,
"name": "StakeUnavailable"
},
{
"index": 25,
"name": "StakeAvailabilityQueryFailed"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0-autogenerated.16562465824776759199",
"version": "0.1.0-autogenerated.11465987119306498744",
"name": "@polkadot-api/descriptors",
"files": [
"dist"
Expand Down
Binary file modified contracts/bridge/integration-tests/.papi/metadata/devnet.scale
Binary file not shown.
4 changes: 2 additions & 2 deletions contracts/bridge/integration-tests/.papi/polkadot-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"devnet": {
"wsUrl": "ws://localhost:9944",
"metadata": ".papi/metadata/devnet.scale",
"genesis": "0x8d485d9a1af12ac341709b0594d287ea058d953e033e1b628b07a0393039c1a4",
"codeHash": "0x1a34b4748c9af1cc638773dd45bf51d8f6b3bd73be129397cc27acbd616641fc"
"genesis": "0x3cb23ebc9e793060c1dde51947b3c7859e47a33402634d9ae751e5ec70ea180f",
"codeHash": "0xd6327a645a01d7fca323c34bead4e71b7c66bb7d37b6f20f9bdb3ac0d86abb95"
}
},
"ink": {
Expand Down
Loading