forked from Nafidinara/creditopia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_icp_ledger.txt
54 lines (43 loc) · 3.91 KB
/
deploy_icp_ledger.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
dfx deploy icp_ledger_canister --argument "(variant {
Init = record {
minting_account = \"$(dfx ledger --identity anonymous account-id)\";
initial_values = vec {
record {
\"$(dfx ledger --identity default account-id)\";
record {
e8s = 10_000_000_000 : nat64;
};
};
};
send_whitelist = vec {};
transfer_fee = opt record {
e8s = 10_000 : nat64;
};
token_symbol = opt \"LICP\";
token_name = opt \"Local ICP\";
}
})
"
TRANSFER KE WALLET:
WALLET_ACCOUNT_ID="$(dfx ledger account-id --of-canister wallet)"
WALLET_ACCOUNT_ID_BYTES="$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$WALLET_ACCOUNT_ID'")]) + "}")')"
dfx canister --identity default call icp_ledger_canister transfer "(record { to = ${WALLET_ACCOUNT_ID_BYTES}; memo = 1; amount = record { e8s = 2_00_000_000 }; fee = record { e8s = 10_000 }; })"
LENDER_ACCOUNT_ID="$(dfx ledger account-id --of-canister LENDER)"
LENDER_ACCOUNT_ID_BYTES="$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$LENDER_ACCOUNT_ID'")]) + "}")')"
dfx canister --identity default call icp_ledger_canister transfer "(record { to = ${LENDER_ACCOUNT_ID_BYTES}; memo = 1; amount = record { e8s = 2_00_000_000 }; fee = record { e8s = 10_000 }; })"
BITFINITY_WALLET_ID="9639db403159fe40c42b0c6090283946588e12fb76e4c1128a6638b4d96f261e"
BITFINITY_WALLET_ID_BYTES="$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$BITFINITY_WALLET_ID'")]) + "}")')"
dfx canister --identity default call icp_ledger_canister transfer "(record { to = ${BITFINITY_WALLET_ID_BYTES}; memo = 1; amount = record { e8s = 2_00_000_000 }; fee = record { e8s = 10_000 }; })"
TRANSFER DARI WALLET:
dfx canister call icp_transfer_backend transfer "(record { amount = record { e8s = 100_000_000 }; toPrincipal = principal \"$(dfx identity --identity default get-principal)\"})"
CALL PAKE IDENTITY
dfx canister --identity default call loan lendToLoan '(2:nat, 10:nat64)'
dfx canister --identity default call loan registerLoan '("Event Coinfest 2024":text, "description of coinfest":text, "Events":text, 100:nat64, 90:nat, 30:nat, 12.0:float64)'
CEK ACCOUNT BALANCE:
dfx canister call icp_ledger_canister account_balance '(record { account = '$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$(dfx ledger --identity default account-id)'")]) + "}")')'})'
dfx canister call icp_ledger_canister account_balance '(record { account = '$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$(dfx ledger --identity wallet account-id)'")]) + "}")')'})'
dfx canister call icp_ledger_canister account_balance '(record { account = '$(python3 -c 'print("vec{" + ";".join([str(b) for b in bytes.fromhex("'$(dfx ledger --identity {NAMA AKUN} account-id)'")]) + "}")')'})'
dfx canister --identity default call loan registerLoan '(principal"r3r33-7bn37-qky3k-54e22-zkrbv-fkcde-wcme4-obvx5-euagl-jnpi3-wqe":principal, "NFT Marketplace Expansion":text, "Expanding our NFT marketplace to new audiences":text, "Events":text, 150:nat64, 180:nat, 45:nat, 10.0:float64)'
dfx canister --identity default call loan registerLoan '(principal"r3r33-7bn37-qky3k-54e22-zkrbv-fkcde-wcme4-obvx5-euagl-jnpi3-wqe":principal, "Web3 Conference 2024":text, "Hosting a global Web3 conference":text, "Events":text, 250:nat64, 150:nat, 30:nat, 8.5:float64)'
dfx canister --identity default call loan registerLoan '(principal"r3r33-7bn37-qky3k-54e22-zkrbv-fkcde-wcme4-obvx5-euagl-jnpi3-wqe":principal, "Blockchain Research Fund":text, "Funding for new blockchain research":text, "Events":text, 300:nat64, 210:nat, 90:nat, 12.5:float64)'
dfx canister --identity default call loan registerLoan '(principal"r3r33-7bn37-qky3k-54e22-zkrbv-fkcde-wcme4-obvx5-euagl-jnpi3-wqe":principal, "Crypto Trading Workshop":text, "Workshop for teaching advanced crypto trading":text, "Events":text, 180:nat64, 60:nat, 20:nat, 9.0:float64)'