Skip to content

Instantly share code, notes, and snippets.

@dakk
Created July 7, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakk/94c0a0a74523c363df8158a621f9c5b3 to your computer and use it in GitHub Desktop.
Save dakk/94c0a0a74523c363df8158a621f9c5b3 to your computer and use it in GitHub Desktop.
yallo_medium_1_using.yallo
import "IToken.yallo";
const tokenContractAddress: address = @KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq;
contract usingAToken {
field bal: nat;
entry checkBalance(a: address) {
[IToken.of(tokenContractAddress).getBalance(a, this.checkBalanceCallback)]
}
entry checkBalanceCallback(b: nat) {
this.bal = b;
[]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment