Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped Filecoin example actor #13

Open
alexytsu opened this issue Jul 19, 2022 · 0 comments
Open

Wrapped Filecoin example actor #13

alexytsu opened this issue Jul 19, 2022 · 0 comments
Labels
documentation/testing Improvements or additions to documentation and/or test coverage frc46 token frc46_token package

Comments

@alexytsu
Copy link
Collaborator

FIL Token Actor

This creates a FIP-??? compliant fungible token that wraps the value of of
native FIL.

Calling the mint (non-standard) method on this actor will increase the
caller's WFIL balance by the amount of FIL sent in the message. The WFIL can be
transferred between any FIP-??? compliant wallets (which have token_received
hook) by either direct transfer or delegated transfer.

https://etherscan.io/tx/0x96a7155b44b77c173e7c534ae1ceca536ba2ce534012ff844cf8c1737bc54921

Direct transfer flow

Call transfer(TransferParams) to directly transfer tokens from the caller's
wallet to a receiving address.

Delegated transfer flow

  1. Call increase_allowance(AllowanceParams) to increase the "spenders"
    allowance
  2. The "spender" can then call this actor with
    transfer_from(TransferFromParams) to

Transferring tokens to this actor

Transferring WFIL to the address of this actor itself will result in the WFIL
being burnt and the corresponding FIL being credited back. This prevents the
case where tokens are unintentionally locked in to contracts that are unable to
receive them. This flow requires the actor to implement its own token_received
hook.

However, also compliant with the token standard would be for this actor to omit
the token_received hook. In this case, transfers to the contract itself would
simply be rejected, which also prevents unintentional loss of tokens.

@alexytsu alexytsu added frc46 token frc46_token package documentation/testing Improvements or additions to documentation and/or test coverage labels Jul 19, 2022
@alexytsu alexytsu removed their assignment Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation/testing Improvements or additions to documentation and/or test coverage frc46 token frc46_token package
Projects
None yet
Development

No branches or pull requests

1 participant