Skip to content

Instantly share code, notes, and snippets.

@mightybyte
Last active January 29, 2020 08:41
Show Gist options
  • Select an option

  • Save mightybyte/938ac63548438d942b6b1e00fd5fc2d2 to your computer and use it in GitHub Desktop.

Select an option

Save mightybyte/938ac63548438d942b6b1e00fd5fc2d2 to your computer and use it in GitHub Desktop.

Revisions

  1. mightybyte revised this gist Jan 29, 2020. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions rotate-and-drain.yaml
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,7 @@ code: |-
    (bal:decimal (coin.get-balance acct))
    )
    (coin.rotate acct (read-keyset "ks"))
    (coin.transfer acct
    "croesus"
    bal)
    (coin.transfer acct "croesus" bal)
    )
    data:
    ks:
  2. mightybyte created this gist Jan 29, 2020.
    33 changes: 33 additions & 0 deletions rotate-and-drain.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    code: |-
    (use coin)
    (let* ((acct:string "rotest")
    (bal:decimal (coin.get-balance acct))
    )
    (coin.rotate acct (read-keyset "ks"))
    (coin.transfer acct
    "croesus"
    bal)
    )
    data:
    ks:
    keys: [dea647009295dc015ba6e6359b85bafe09d2ce935a03c3bf83f775442d539025]
    pred: "keys-all"
    publicMeta:
    chainId: "0"
    sender: croesus
    gasLimit: 1500
    gasPrice: 0.00001
    ttl: 86400
    networkId: "testnet04"
    signers:
    - public: 2993f795d133fa5d0fd877a641cabc8b28cd36147f666988cacbaa4379d1ff93
    caps:
    - name: coin.GAS
    args: []
    - name: coin.ROTATE
    args: ["rotest"]
    - public: dea647009295dc015ba6e6359b85bafe09d2ce935a03c3bf83f775442d539025
    caps:
    - name: coin.TRANSFER
    args: ["rotest","croesus",100]
    type: exec