5
5
6
6
7
7
8
+ - [ Struct ` BridgeConfigRelayerUpdated ` ] ( #0x1_native_bridge_BridgeConfigRelayerUpdated )
9
+ - [ Struct ` BridgeFeeChangedEvent ` ] ( #0x1_native_bridge_BridgeFeeChangedEvent )
10
+ - [ Struct ` BridgeInsuranceBudgetDividerChangedEvent ` ] ( #0x1_native_bridge_BridgeInsuranceBudgetDividerChangedEvent )
11
+ - [ Struct ` BridgeInsuranceFundChangedEvent ` ] ( #0x1_native_bridge_BridgeInsuranceFundChangedEvent )
12
+ - [ Struct ` BridgeTransferInitiatedEvent ` ] ( #0x1_native_bridge_BridgeTransferInitiatedEvent )
13
+ - [ Struct ` BridgeTransferCompletedEvent ` ] ( #0x1_native_bridge_BridgeTransferCompletedEvent )
14
+ - [ Resource ` BridgeEvents ` ] ( #0x1_native_bridge_BridgeEvents )
8
15
- [ Resource ` AptosCoinBurnCapability ` ] ( #0x1_native_bridge_AptosCoinBurnCapability )
9
16
- [ Resource ` AptosCoinMintCapability ` ] ( #0x1_native_bridge_AptosCoinMintCapability )
10
17
- [ Resource ` AptosFABurnCapabilities ` ] ( #0x1_native_bridge_AptosFABurnCapabilities )
11
18
- [ Resource ` AptosFAMintCapabilities ` ] ( #0x1_native_bridge_AptosFAMintCapabilities )
12
- - [ Struct ` BridgeTransferInitiatedEvent ` ] ( #0x1_native_bridge_BridgeTransferInitiatedEvent )
13
- - [ Struct ` BridgeTransferCompletedEvent ` ] ( #0x1_native_bridge_BridgeTransferCompletedEvent )
14
- - [ Resource ` BridgeEvents ` ] ( #0x1_native_bridge_BridgeEvents )
15
19
- [ Resource ` Nonce ` ] ( #0x1_native_bridge_Nonce )
20
+ - [ Resource ` OutboundRateLimitBudget ` ] ( #0x1_native_bridge_OutboundRateLimitBudget )
21
+ - [ Resource ` InboundRateLimitBudget ` ] ( #0x1_native_bridge_InboundRateLimitBudget )
16
22
- [ Resource ` SmartTableWrapper ` ] ( #0x1_native_bridge_SmartTableWrapper )
17
23
- [ Struct ` OutboundTransfer ` ] ( #0x1_native_bridge_OutboundTransfer )
18
24
- [ Resource ` BridgeConfig ` ] ( #0x1_native_bridge_BridgeConfig )
19
- - [ Struct ` BridgeConfigRelayerUpdated ` ] ( #0x1_native_bridge_BridgeConfigRelayerUpdated )
20
- - [ Struct ` BridgeFeeChangedEvent ` ] ( #0x1_native_bridge_BridgeFeeChangedEvent )
21
25
- [ Constants] ( #@Constants_0 )
26
+ - [ Function ` initialize ` ] ( #0x1_native_bridge_initialize )
22
27
- [ Function ` normalize_u64_to_32_bytes ` ] ( #0x1_native_bridge_normalize_u64_to_32_bytes )
23
28
- [ Function ` is_inbound_nonce_set ` ] ( #0x1_native_bridge_is_inbound_nonce_set )
24
29
- [ Function ` create_details ` ] ( #0x1_native_bridge_create_details )
25
30
- [ Function ` add ` ] ( #0x1_native_bridge_add )
26
31
- [ Function ` set_bridge_transfer_id_to_inbound_nonce ` ] ( #0x1_native_bridge_set_bridge_transfer_id_to_inbound_nonce )
27
32
- [ Function ` assert_valid_bridge_transfer_id ` ] ( #0x1_native_bridge_assert_valid_bridge_transfer_id )
28
33
- [ Function ` bridge_transfer_id ` ] ( #0x1_native_bridge_bridge_transfer_id )
34
+ - [ Function ` bridge_relayer ` ] ( #0x1_native_bridge_bridge_relayer )
35
+ - [ Function ` insurance_fund ` ] ( #0x1_native_bridge_insurance_fund )
36
+ - [ Function ` insurance_budget_divider ` ] ( #0x1_native_bridge_insurance_budget_divider )
37
+ - [ Function ` bridge_fee ` ] ( #0x1_native_bridge_bridge_fee )
29
38
- [ Function ` get_bridge_transfer_details_from_nonce ` ] ( #0x1_native_bridge_get_bridge_transfer_details_from_nonce )
30
39
- [ Function ` get_inbound_nonce_from_bridge_transfer_id ` ] ( #0x1_native_bridge_get_inbound_nonce_from_bridge_transfer_id )
31
40
- [ Function ` increment_and_get_nonce ` ] ( #0x1_native_bridge_increment_and_get_nonce )
32
- - [ Function ` initialize ` ] ( #0x1_native_bridge_initialize )
33
41
- [ Function ` store_aptos_coin_burn_cap ` ] ( #0x1_native_bridge_store_aptos_coin_burn_cap )
34
42
- [ Function ` store_aptos_coin_mint_cap ` ] ( #0x1_native_bridge_store_aptos_coin_mint_cap )
43
+ - [ Function ` mint_to ` ] ( #0x1_native_bridge_mint_to )
35
44
- [ Function ` mint ` ] ( #0x1_native_bridge_mint )
36
- - [ Function ` mint_from ` ] ( #0x1_native_bridge_mint_from )
45
+ - [ Function ` mint_internal ` ] ( #0x1_native_bridge_mint_internal )
37
46
- [ Function ` burn_from ` ] ( #0x1_native_bridge_burn_from )
38
47
- [ Function ` burn ` ] ( #0x1_native_bridge_burn )
39
48
- [ Function ` burn_internal ` ] ( #0x1_native_bridge_burn_internal )
42
51
- [ Function ` charge_bridge_fee ` ] ( #0x1_native_bridge_charge_bridge_fee )
43
52
- [ Function ` update_bridge_relayer ` ] ( #0x1_native_bridge_update_bridge_relayer )
44
53
- [ Function ` update_bridge_fee ` ] ( #0x1_native_bridge_update_bridge_fee )
45
- - [ Function ` bridge_relayer ` ] ( #0x1_native_bridge_bridge_relayer )
46
- - [ Function ` bridge_fee ` ] ( #0x1_native_bridge_bridge_fee )
54
+ - [ Function ` update_insurance_fund ` ] ( #0x1_native_bridge_update_insurance_fund )
55
+ - [ Function ` update_insurance_budget_divider ` ] ( #0x1_native_bridge_update_insurance_budget_divider )
47
56
- [ Function ` assert_is_caller_relayer ` ] ( #0x1_native_bridge_assert_is_caller_relayer )
57
+ - [ Function ` assert_outbound_rate_limit_budget_not_exceeded ` ] ( #0x1_native_bridge_assert_outbound_rate_limit_budget_not_exceeded )
58
+ - [ Function ` assert_inbound_rate_limit_budget_not_exceeded ` ] ( #0x1_native_bridge_assert_inbound_rate_limit_budget_not_exceeded )
48
59
- [ Function ` test_normalize_u64_to_32_bytes_helper ` ] ( #0x1_native_bridge_test_normalize_u64_to_32_bytes_helper )
49
60
50
61
@@ -1374,6 +1385,36 @@ Stores the mint capability for AptosCoin.
1374
1385
1375
1386
1376
1387
1388
+ </details >
1389
+
1390
+ <a id =" 0x1_native_bridge_mint_to " ></a >
1391
+
1392
+ ## Function ` mint_to `
1393
+
1394
+ Mints a specified amount of AptosCoin to a recipient's address.
1395
+
1396
+ @param core_resource The signer representing the core resource account.
1397
+ @param recipient The address of the recipient to mint coins to.
1398
+ @param amount The amount of AptosCoin to mint.
1399
+
1400
+
1401
+ <pre ><code ><b >public</b > <b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_to " >mint_to</a >(aptos_framework: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, recipient: <b >address</b >, amount: u64)
1402
+ </code ></pre >
1403
+
1404
+
1405
+
1406
+ <details >
1407
+ <summary >Implementation</summary >
1408
+
1409
+
1410
+ <pre ><code ><b >public</b > <b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_to " >mint_to</a >(aptos_framework: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, recipient: <b >address</b >, amount: u64) <b >acquires</b > <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a > {
1411
+ <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(aptos_framework);
1412
+ <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal</a >(recipient, amount);
1413
+ }
1414
+ </code ></pre >
1415
+
1416
+
1417
+
1377
1418
</details >
1378
1419
1379
1420
<a id =" 0x1_native_bridge_mint " ></a >
@@ -1399,29 +1440,25 @@ Mints a specified amount of AptosCoin to a recipient's address.
1399
1440
<pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint " >mint</a >(recipient: <b >address</b >, amount: u64) <b >acquires</b > <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a > {
1400
1441
<b >assert</b >!(<a href =" ../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_abort_native_bridge_enabled " >features::abort_native_bridge_enabled</a >(), <a href =" native_bridge.md#0x1_native_bridge_ENATIVE_BRIDGE_NOT_ENABLED " >ENATIVE_BRIDGE_NOT_ENABLED</a >);
1401
1442
1402
- <a href =" coin.md#0x1_coin_deposit " >coin::deposit</a >(recipient, <a href =" coin.md#0x1_coin_mint " >coin::mint</a >(
1403
- amount,
1404
- &<b >borrow_global</b >< ; <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a >> ; (@aptos_framework).mint_cap
1405
- ));
1443
+ <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal</a >(recipient, amount);
1406
1444
}
1407
1445
</code ></pre >
1408
1446
1409
1447
1410
1448
1411
1449
</details >
1412
1450
1413
- <a id =" 0x1_native_bridge_mint_from " ></a >
1451
+ <a id =" 0x1_native_bridge_mint_internal " ></a >
1414
1452
1415
- ## Function ` mint_from `
1453
+ ## Function ` mint_internal `
1416
1454
1417
1455
Mints a specified amount of AptosCoin to a recipient's address.
1418
1456
1419
- @param core_resource The signer representing the core resource account.
1420
1457
@param recipient The address of the recipient to mint coins to.
1421
1458
@param amount The amount of AptosCoin to mint.
1422
1459
1423
1460
1424
- <pre ><code ><b >public</ b > < b > fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_from " >mint_from </a >(aptos_framework: &< a href = " ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</ a >, recipient: <b >address</b >, amount: u64)
1461
+ <pre ><code ><b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal </a >(recipient: <b >address</b >, amount: u64)
1425
1462
</code ></pre >
1426
1463
1427
1464
@@ -1430,9 +1467,11 @@ Mints a specified amount of AptosCoin to a recipient's address.
1430
1467
<summary >Implementation</summary >
1431
1468
1432
1469
1433
- <pre ><code ><b >public</b > <b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_from " >mint_from</a >(aptos_framework: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, recipient: <b >address</b >, amount: u64) <b >acquires</b > <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a > {
1434
- <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(aptos_framework);
1435
- <a href =" native_bridge.md#0x1_native_bridge_mint " >mint</a >(recipient, amount);
1470
+ <pre ><code ><b >fun</b > <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal</a >(recipient: <b >address</b >, amount: u64) <b >acquires</b > <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a > {
1471
+ <a href =" coin.md#0x1_coin_deposit " >coin::deposit</a >(recipient, <a href =" coin.md#0x1_coin_mint " >coin::mint</a >(
1472
+ amount,
1473
+ &<b >borrow_global</b >< ; <a href =" native_bridge.md#0x1_native_bridge_AptosCoinMintCapability " >AptosCoinMintCapability</a >> ; (@aptos_framework).mint_cap
1474
+ ));
1436
1475
}
1437
1476
</code ></pre >
1438
1477
@@ -1670,7 +1709,7 @@ Completes a bridge transfer on the destination chain.
1670
1709
<a href =" native_bridge.md#0x1_native_bridge_set_bridge_transfer_id_to_inbound_nonce " >set_bridge_transfer_id_to_inbound_nonce</a >(bridge_transfer_id, nonce);
1671
1710
1672
1711
// Mint <b >to</b > the recipient
1673
- <a href =" native_bridge.md#0x1_native_bridge_mint " >mint </a >(recipient, amount);
1712
+ <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal </a >(recipient, amount);
1674
1713
1675
1714
// Emit the <a href =" event.md#0x1_event " >event</a >
1676
1715
<b >let</b > bridge_events = <b >borrow_global_mut</b >< ; <a href =" native_bridge.md#0x1_native_bridge_BridgeEvents " >BridgeEvents</a >> ; (@aptos_framework);
@@ -1716,7 +1755,7 @@ Charge bridge fee to the initiate bridge transfer.
1716
1755
<b >let</b > bridge_relayer = <a href =" native_bridge.md#0x1_native_bridge_bridge_relayer " >bridge_relayer</a >();
1717
1756
<b >assert</b >!(amount > ; bridge_fee, <a href =" native_bridge.md#0x1_native_bridge_EINVALID_AMOUNT " >EINVALID_AMOUNT</a >);
1718
1757
<b >let</b > new_amount = amount - bridge_fee;
1719
- <a href =" native_bridge.md#0x1_native_bridge_mint " >mint </a >(bridge_relayer, bridge_fee);
1758
+ <a href =" native_bridge.md#0x1_native_bridge_mint_internal " >mint_internal </a >(bridge_relayer, bridge_fee);
1720
1759
new_amount
1721
1760
}
1722
1761
</code ></pre >
0 commit comments