There was an error while loading. Please reload this page.
1 parent bfdeda4 commit 6b1ca7eCopy full SHA for 6b1ca7e
1 file changed
mytoken/sources/my_token.move
@@ -5,9 +5,9 @@ module MyToken::coin {
5
+ use 0x1::signer;
6
7
/// Resource that represents a simple token
8
- struct Coin has key {
9
- value: u64,
10
- }
+ struct Coin has store {
+ value: u64,
+}
11
12
const EINSUFFICIENT_BALANCE: u64 = 1;
13
@@ -23,7 +23,7 @@ module MyToken::coin {
23
24
/// Transfer tokens
25
public fun transfer(from: &mut Coin, amount: u64): Coin {
26
- assert!(from.value >= amount, error::invalid_argument(EINSUFFICIENT_BALANCE));
+ assert!(from.value >= amount, EINSUFFICIENT_BALANCE);
27
from.value = from.value - amount;
28
Coin { value: amount }
29
}
0 commit comments