Skip to content

feat(tri27): Token FFI for TRI-27 #442

@gHashTag

Description

@gHashTag

Sub-Issue #437: Token FFI for TRI-27

Files: src/tri27/token_ffi.zig (NEW, ~400 LOC)

Tasks:

  • Create spec/token_ffi.tri
  • Generate token_ffi.zig via tri gen
  • Define TokenContract interface:
    • balanceOf(address) -> u128
    • transfer(to, amount) -> bool
    • stake(amount, lock_period) -> void
    • unstake() -> u128
    • claimRewards() -> u128
  • Implement Web3 RPC calls:
    • encodeCall(contract, method, params)
    • sendTransaction(signer, to, value, data)
    • waitForReceipt(tx_hash)
  • Add error handling:
    • Revert by reason
    • Out of gas
    • Network error

Parent: #435

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions