1 | | - | {-# STDLIB_VERSION 6 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let powerAddress = Address(base58'3P86ne9inVG1Cf4smrEGSdcXyBuEApPcMAc') |
---|
5 | | - | |
---|
6 | | - | let ownerAddress = Address(base58'3P4pKfj9UZHqj6pb18921oSftYuQw35gExR') |
---|
7 | | - | |
---|
8 | | - | let POWER = base58'2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21' |
---|
9 | | - | |
---|
10 | | - | func asInt (v) = match v { |
---|
11 | | - | case x: Int => |
---|
12 | | - | x |
---|
13 | | - | case t => |
---|
14 | | - | throw("#err") |
---|
15 | | - | } |
---|
16 | | - | |
---|
17 | | - | |
---|
18 | | - | @Callable(i) |
---|
19 | | - | func unstake_power () = { |
---|
20 | | - | let power_amount = asInt(invoke(powerAddress, "userPower", [toString(this)], nil)) |
---|
21 | | - | if ((power_amount == power_amount)) |
---|
22 | | - | then { |
---|
23 | | - | let unstake = invoke(powerAddress, "unstake", [power_amount], nil) |
---|
24 | | - | if ((unstake == unstake)) |
---|
25 | | - | then [ScriptTransfer(ownerAddress, assetBalance(this, POWER), POWER)] |
---|
26 | | - | else throw("Strict value is not equal to itself.") |
---|
27 | | - | } |
---|
28 | | - | else throw("Strict value is not equal to itself.") |
---|
29 | | - | } |
---|
30 | | - | |
---|
31 | | - | |
---|
| 1 | + | # no script |
---|