Skip to content

Commit 422f479

Browse files
committed
Issue SRT
1 parent 29be328 commit 422f479

2 files changed

Lines changed: 65 additions & 7 deletions

File tree

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ CLIENT_WALLET_PK_BYTES=
2525
# USDC issuer
2626
USDC_ISSUER_SECRET=
2727
USDC_ISSUER_PUBLIC=
28+
29+
# SRT issuer
30+
SRT_ISSUER_SECRET=
31+
SRT_ISSUER_PUBLIC=
32+
33+
# Test Anchor Distribution Account
34+
TESTANCHOR_DISTRIBUTION_SECRET=
35+
TESTANCHOR_DISTRIBUTION_PUBLIC=

scripts/testnet_reset.sh

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ fund_test_accounts() {
5656
"TEST_WITHDRAW_FUND_CLIENT_SECRET_2:GASI56WX7UKIDFPZRCQEI4OQE3V3QBGXEOB4ZY6ZMU5MZXPHQHIDA7JU"
5757
"TEST_DEPOSIT_FUND_CLIENT_SECRET_1:GD4C2QRT7YL4WJFJPYQCYRXEDBB7ERHC3XZGWR6KXKRHPEFXXNXIVNFY"
5858
"TEST_DEPOSIT_FUND_CLIENT_SECRET_2:GC56VTOVOJDRQAJRYLZW6DLQGVTQSYDTZU7ISNIZ2VJIE3FYWI2HMD5G"
59+
"SRT_ISSUER_SECRET:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B"
60+
"TESTANCHOR_DISTRIBUTION_SECRET:GABCKCYPAGDDQMSCTMSBO7C2L34NU3XXCW7LR4VVSWCCXMAJY3B4YCZP"
5961
)
6062

6163
for account_info in "${accounts[@]}"; do
@@ -69,31 +71,52 @@ fund_test_accounts() {
6971
}
7072

7173
setup_trustlines() {
72-
log_info "Setting up USDC trustlines..."
74+
log_info "Setting up trustlines..."
7375
local usdc_issuer="${USDC_ISSUER_PUBLIC:-GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP}"
7476
local circle_usdc_issuer="GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
77+
local srt_issuer="${SRT_ISSUER_PUBLIC:-GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B}"
7578
local accounts=(
7679
"TEST_CLIENT_WALLET_SECRET"
7780
"TEST_WITHDRAW_FUND_CLIENT_SECRET_1"
7881
"TEST_WITHDRAW_FUND_CLIENT_SECRET_2"
7982
"TEST_DEPOSIT_FUND_CLIENT_SECRET_1"
8083
"TEST_DEPOSIT_FUND_CLIENT_SECRET_2"
84+
"TESTANCHOR_DISTRIBUTION_SECRET"
8185
)
8286

8387
for account_var in "${accounts[@]}"; do
8488
local account_secret="${!account_var}"
8589
if [[ -n "$account_secret" ]]; then
86-
stellar tx new change-trust \
90+
# Create USDC trustlines
91+
if stellar tx new change-trust \
8792
--source-account "$account_secret" \
8893
--network testnet \
89-
--line "USDC:$usdc_issuer" >/dev/null 2>&1
90-
log_success "Anchor USDC trustline created for $account_var"
94+
--line "USDC:$usdc_issuer"; then
95+
log_success "Anchor USDC trustline created for $account_var"
96+
else
97+
log_warning "Failed to create Anchor USDC trustline for $account_var"
98+
fi
9199

92-
stellar tx new change-trust \
100+
if stellar tx new change-trust \
93101
--source-account "$account_secret" \
94102
--network testnet \
95-
--line "USDC:$circle_usdc_issuer" >/dev/null 2>&1
96-
log_success "Circle USDC trustline created for $account_var"
103+
--line "USDC:$circle_usdc_issuer"; then
104+
log_success "Circle USDC trustline created for $account_var"
105+
else
106+
log_warning "Failed to create Circle USDC trustline for $account_var"
107+
fi
108+
109+
# Create SRT trustline only for TESTANCHOR_DISTRIBUTION_SECRET
110+
if [[ "$account_var" == "TESTANCHOR_DISTRIBUTION_SECRET" ]]; then
111+
if stellar tx new change-trust \
112+
--source-account "$account_secret" \
113+
--network testnet \
114+
--line "SRT:$srt_issuer"; then
115+
log_success "SRT trustline created for $account_var"
116+
else
117+
log_warning "Failed to create SRT trustline for $account_var"
118+
fi
119+
fi
97120
fi
98121
sleep 1
99122
done
@@ -104,8 +127,10 @@ issue_and_fund_usdc() {
104127
local usdc_issuer_secret="$USDC_ISSUER_SECRET"
105128
local usdc_issuer_public="${USDC_ISSUER_PUBLIC:-GDQOE23CFSUMSVQK4Y5JHPPYK73VYCNHZHA7ENKCV37P6SUEO6XQBKPP}"
106129

130+
# Fund USDC issuer
107131
fund_account "$usdc_issuer_public"
108132

133+
# Fund USDC to test accounts
109134
local recipient_accounts=(
110135
"TEST_CLIENT_WALLET_SECRET:GDJLBYYKMCXNVVNABOE66NYXQGIA5AC5D223Z2KF6ZEYK4UBCA7FKLTG"
111136
"TEST_WITHDRAW_FUND_CLIENT_SECRET_1:GDC2U5GRKUSPGV5XENLBWKQZH2C4PG7ZEVMQOUA2QZKIRXE5FYYEMEF7"
@@ -135,6 +160,30 @@ issue_and_fund_usdc() {
135160
log_warning "Skipping $account_var (no secret key found)"
136161
fi
137162
done
163+
164+
}
165+
166+
issue_and_fund_srt() {
167+
log_info "Issuing SRT and funding test anchor distribution account..."
168+
local srt_issuer_secret="$SRT_ISSUER_SECRET"
169+
local srt_issuer_public="${SRT_ISSUER_PUBLIC:-GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B}"
170+
171+
# Fund SRT issuer
172+
fund_account "$srt_issuer_public"
173+
174+
# Fund SRT to test anchor distribution account
175+
local anchor_dist_public="${TESTANCHOR_DISTRIBUTION_PUBLIC:-GABCKCYPAGDDQMSCTMSBO7C2L34NU3XXCW7LR4VVSWCCXMAJY3B4YCZP}"
176+
log_info "Sending 1000000 SRT to test anchor distribution account..."
177+
if stellar tx new payment \
178+
--source-account "$srt_issuer_secret" \
179+
--destination "$anchor_dist_public" \
180+
--asset "SRT:$srt_issuer_public" \
181+
--amount 10000000000000 \
182+
--network testnet; then
183+
log_success "Sent 1000000 SRT to test anchor distribution account"
184+
else
185+
log_warning "Failed to send SRT to test anchor distribution account"
186+
fi
138187
}
139188

140189
reset_multisig() {
@@ -228,6 +277,7 @@ main() {
228277
reset_multisig
229278
setup_trustlines
230279
issue_and_fund_usdc
280+
issue_and_fund_srt
231281
deploy_contracts
232282
log_success "✨ Testnet setup completed!"
233283
}

0 commit comments

Comments
 (0)