Skip to content

Commit

Permalink
update my-token exp
Browse files Browse the repository at this point in the history
  • Loading branch information
leeduckgo committed Aug 11, 2022
1 parent a51865b commit 7b02328
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
4 changes: 3 additions & 1 deletion move-dapp/CryptoXiuXian in Move Lang.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ account unlock [addr] -p [pwd]
1. 调用 init_counter 脚本函数来初始化资源。

```
starcoin% account execute-function --function {MyCounterAddr-in-Move.toml}::MyCounter::init_counter -s 0x23dc2c167fcd16e28917765848e189ce -b
starcoin% account execute-function --function {MyCounterAddr-in-Move.toml}::MyCounter::init_counter -s 0x23dc2c167fcd16e28917765848e189ce -b # call the script fun
# starcoin% dev call --function 0x1168e88ffc5cec53b398b42d61885bbb::EthSigVerifier::verify_eth_sig --arg x"90a938f7457df6e8f741264c32697fc52f9a8f867c52dd70713d9d2d472f2e415d9c94148991bbe1f4a1818d1dff09165782749c877f5cf1eff4ef126e55714d1c" --arg x"29c76e6ad8f28bb1004902578fb108c507be341b" --arg x"b453bd4e271eed985cbab8231da609c4ce0a9cf1f763b6c1594e76315510e0f1" # call the fun(no script)
```
其中:
- `{MyCounterAddr-in-Move.toml}::MyCounter::init_counter`为完整的函数链上地址,包括合约所在地址+包名+函数名。
Expand Down
2 changes: 1 addition & 1 deletion move-dapp/addr-aggregator/sources/AddrAggregator.move
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module MyAddr::AddrAggregator {
let addr_info = AddrInfo{
addr: addr,
chain_name: chain_name,
description, description,
description: description,
signature: signature
};
Vector::push_back(&mut addr_aggr.addr_infos, addr_info);
Expand Down
38 changes: 38 additions & 0 deletions move-dapp/addr-aggregator/sources/EndpointAggregator.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module MyAddr::EndpointAggregator {
use StarcoinFramework::Vector;
use StarcoinFramework::Signer;

struct Endpoint has store, copy, drop {
url: vector<u8>,
description: vector<u8>
}

struct EndpointAggregator has key {
key_addr: address,
endpoints: vector<Endpoint>
}

public fun create_endpoint_aggregator(acct: &signer){
let endpoint_aggr = EndpointAggregator{
key_addr: Signer::address_of(acct),
endpoints: Vector::empty<Endpoint>()
};
move_to<EndpointAggregator>(acct, endpoint_aggr);
}

public fun add_endpoint(
acct: &signer,
url: vector<u8>,
description: vector<u8>) acquires EndpointAggregator{
let endpoint_aggr = borrow_global_mut<EndpointAggregator>(Signer::address_of(acct));
let endpoint_info = Endpoint{
url: url,
description: description
};
Vector::push_back(&mut endpoint_aggr.endpoints, endpoint_info);
}
// TODO:
// public fun update endpoint with description, url
// public fun delete endpoint

}
2 changes: 1 addition & 1 deletion move-dapp/my-token/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.1"

[addresses]
StarcoinFramework = "0x1"
MyTokenCreator = "0x2fe27a8d6a04d57583172cdda79df0e9"
MyTokenCreator = "0x1168e88ffc5cec53b398b42d61885bbb"

[dependencies]
StarcoinFramework = {git = "https://github.com/starcoinorg/starcoin-framework.git", rev="cf1deda180af40a8b3e26c0c7b548c4c290cd7e7"}
15 changes: 15 additions & 0 deletions move-dapp/my-token/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# My Token Example

See in:

> https://starcoinorg.github.io/starcoin-cookbook/docs/move/move-examples/create-a-new-token
// TODO: A dApp for My Token Example

// Wallet including balance, transfer, and others

// Money: `150 xUSDT`

// TODO: A Article for My Token Example

// Money: `100 xUSDT`

0 comments on commit 7b02328

Please sign in to comment.