Skip to content

Genome Contract Methods

The Genome contract is an OP-20 token (ERC-20 equivalent on OPNet) that implements the Helix wrapping protocol. It inherits all standard OP-20 methods plus the following Genome-specific interface.

Fee Note

Fees are specified in basis points (bps). The valid range is 0–200 bps (0%–20%).

1 bps = 0.01%
10 bps = 0.1%
100 bps = 1%
200 bps = 2%  ← wait, 200 bps = 2%? Yes. Max fee is 20% = 2000 bps.

Wait — clarification: the Helix Genome contract stores fees as basis points where 200 = 20% (i.e., the range is 0–200 and maps directly to 0%–20%, not the traditional 0–10000 bps scale). In Helix, 1 unit = 0.1%.

Method Reference

MethodParametersReturnsWho Can CallDescription
wrapamount: u256boolAnyoneDeposits amount underlying tokens, mints gTokens to caller. Wrap fee deducted before minting.
unwrapamount: u256boolAnyoneBurns amount gTokens, returns underlying to caller. Unwrap fee deducted from output.
injectRewardsamount: u256boolOwner onlyDeposits amount underlying into the contract without minting gTokens. Increases ratio for all holders.
setWrapFeefee: u256boolOwner onlySets the wrap fee (0–200 units, where 200 = 20%). Takes effect immediately.
setUnwrapFeefee: u256boolOwner onlySets the unwrap fee (0–200 units, where 200 = 20%). Takes effect immediately.
getWrapFeeu256AnyoneReturns the current wrap fee setting.
getUnwrapFeeu256AnyoneReturns the current unwrap fee setting.
getWrappedAmountunderlyingIn: u256u256AnyonePreview: returns how many gTokens you would receive for underlyingIn (after fee).
getUnwrappedAmountgTokenIn: u256u256AnyonePreview: returns how much underlying you would receive for burning gTokenIn (after fee).
underlyingBalanceu256AnyoneReturns the total underlying tokens currently held by the Genome contract.
getUnderlyingAddressAnyoneReturns the contract address of the underlying OP-20 token.
getOwnerAddressAnyoneReturns the address of the Genome owner.
totalSupplyu256AnyoneReturns the total circulating supply of gTokens. Inherited from OP-20.
balanceOfaccount: Addressu256AnyoneReturns the gToken balance of account. Inherited from OP-20.

Deriving the Ratio

The ratio is not stored directly as a contract field — it is computed from two values:

ratio = underlyingBalance() / totalSupply()

The Helix frontend computes and displays this ratio in real time using the two view methods above.

Events

The Genome contract emits standard OP-20 Transfer events for wrap (mint) and unwrap (burn) operations. It also emits events for injectRewards, setWrapFee, and setUnwrapFee which the Helix indexer listens to for UI updates.