You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
784 B
31 lines
784 B
fun stakingDepositMessage(value: Int, pool: Address): SendParameters { |
|
return SendParameters{ |
|
to: pool, |
|
value: value, |
|
body: beginCell().storeSlice("Deposit".asSlice()).endCell() |
|
}; |
|
} |
|
|
|
fun stakingWithdrawMessage(value: Int, pool: Address): SendParameters { |
|
return SendParameters{ |
|
to: pool, |
|
value: ton("0.05"), |
|
body: beginCell().storeUint(3665837821, 32).storeCoins(value).endCell() |
|
}; |
|
} |
|
|
|
struct WithdrawalRequests { |
|
addresses: map[Int]Address; |
|
amounts: map[Int]Int; |
|
n_requests: Int; |
|
} |
|
|
|
fun withdrawalSum(requests: WithdrawalRequests): Int { |
|
let sum: Int = 0; |
|
let i: Int = 0; |
|
while(i < requests.n_requests) { |
|
sum = sum + requests.amounts.get(i)!!; |
|
i = i + 1; |
|
} |
|
return sum; |
|
} |