Skip to content

Commit 2750b24

Browse files
committed
add readme for token example actor
1 parent 2075285 commit 2750b24

File tree

1 file changed

+35
-0
lines changed
  • testing/integration/actors/fil_token_actor

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# FIL Token Actor
2+
3+
This creates a FIP-??? compliant fungible token that wraps the value of of
4+
native FIL.
5+
6+
Calling the `mint` (non-standard) method on this actor will increase the
7+
caller's WFIL balance by the amount of FIL sent in the message. The WFIL can be
8+
transferred between any FIP-??? compliant wallets (which have `token_received`
9+
hook) by either direct transfer or delegated transfer.
10+
11+
https://etherscan.io/tx/0x96a7155b44b77c173e7c534ae1ceca536ba2ce534012ff844cf8c1737bc54921
12+
13+
## Direct transfer flow
14+
15+
Call `transfer(TransferParams)` to directly transfer tokens from the caller's
16+
wallet to a receiving address.
17+
18+
## Delegated transfer flow
19+
20+
1. Call `increase_allowance(AllowanceParams)` to increase the "spenders"
21+
allowance
22+
2. The "spender" can then call this actor with
23+
`transfer_from(TransferFromParams)` to
24+
25+
## Transferring tokens to this actor
26+
27+
Transferring WFIL to the address of this actor itself will result in the WFIL
28+
being burnt and the corresponding FIL being credited back. This prevents the
29+
case where tokens are unintentionally locked in to contracts that are unable to
30+
receive them. This flow requires the actor to implement its own `token_received`
31+
hook.
32+
33+
However, also compliant with the token standard would be for this actor to omit
34+
the `token_received` hook. In this case, transfers to the contract itself would
35+
simply be rejected, which also prevents unintentional loss of tokens.

0 commit comments

Comments
 (0)