File tree Expand file tree Collapse file tree 5 files changed +10
-0
lines changed
single_token_single_sub_vault/src Expand file tree Collapse file tree 5 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ storage {
40
40
}
41
41
42
42
impl SRC6 for Contract {
43
+ #[payable]
43
44
#[storage(read, write)]
44
45
fn deposit (receiver : Identity , vault_sub_id : SubId ) -> u64 {
45
46
let asset_amount = msg_amount ();
@@ -76,6 +77,7 @@ impl SRC6 for Contract {
76
77
shares
77
78
}
78
79
80
+ #[payable]
79
81
#[storage(read, write)]
80
82
fn withdraw (
81
83
receiver : Identity ,
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ storage {
37
37
}
38
38
39
39
impl SRC6 for Contract {
40
+ #[payable]
40
41
#[storage(read, write)]
41
42
fn deposit (receiver : Identity , vault_sub_id : SubId ) -> u64 {
42
43
require (vault_sub_id == ACCEPTED_SUB_VAULT , " INVALID_vault_sub_id" );
@@ -69,6 +70,7 @@ impl SRC6 for Contract {
69
70
shares
70
71
}
71
72
73
+ #[payable]
72
74
#[storage(read, write)]
73
75
fn withdraw (
74
76
receiver : Identity ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ configurable {
46
46
}
47
47
48
48
impl SRC6 for Contract {
49
+ #[payable]
49
50
#[storage(read, write)]
50
51
fn deposit (receiver : Identity , vault_sub_id : SubId ) -> u64 {
51
52
let asset_amount = msg_amount ();
@@ -83,6 +84,7 @@ impl SRC6 for Contract {
83
84
shares
84
85
}
85
86
87
+ #[payable]
86
88
#[storage(read, write)]
87
89
fn withdraw (
88
90
receiver : Identity ,
Original file line number Diff line number Diff line change @@ -153,9 +153,11 @@ Incorrect implementation of token vaults could allow attackers to steal underlyi
153
153
154
154
``` sway
155
155
abi SRC6 {
156
+ #[payable]
156
157
#[storage(read, write)]
157
158
fn deposit(receiver: Identity, vault_sub_id: SubId) -> u64;
158
159
160
+ #[payable]
159
161
#[storage(read, write)]
160
162
fn withdraw(receiver: Identity, underlying_asset: AssetId, vault_sub_id: SubId) -> u64;
161
163
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ abi SRC6 {
53
53
/// * If the asset is not supported by the contract.
54
54
/// * If the amount of assets forwarded to the contract is zero.
55
55
/// * The user crosses any global or user specific deposit limits.
56
+ #[payable]
56
57
#[storage(read, write)]
57
58
fn deposit (receiver : Identity , vault_sub_id : SubId ) -> u64 ;
58
59
@@ -78,6 +79,7 @@ abi SRC6 {
78
79
/// * If the amount of shares is zero.
79
80
/// * If the transferred shares do not corresspond to the given asset.
80
81
/// * The user crosses any global or user specific withdrawal limits.
82
+ #[payable]
81
83
#[storage(read, write)]
82
84
fn withdraw (
83
85
receiver : Identity ,
You can’t perform that action at this time.
0 commit comments