Function: createRail(address token, address from, address to, address validator, uint256 commissionRateBps, address serviceFeeRecipient)
Create a new rail from from
to to
, operated by the caller. Can only be called by an approved operator.
Inputs
token
Control: Fully controlled by the caller.
Constraints: No direct constraints, but the caller has to be approved to create rails using the given token.
Impact: The ERC20 token address for payments on this rail.
from
Control: Fully controlled by the caller.
Constraints: Non-zero, and the caller has to be approved to create rails using the given given address.
Impact: The client address (payer) for this rail.
to
Control: Fully controlled by the caller.
Constraints: Non-zero.
Impact: The recipient address for payments on this rail.
validator
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Optional address of an validator contract (can be address(0) for no validation).
commissionRateBps
Control: Fully controlled by the caller.
Constraints: Lower than or equal to COMMISSION_MAX_BPS.
Impact: Optional operator commission in basis points (0-10000).
serviceFeeRecipient
Control: Fully controlled by the caller.
Constraints: Non-zero if there is no commission..
Impact: Address to receive operator commission.
Branches and code coverage
Intended branches
Approved operator creates a rail with commission.
Approved operator creates a rail without commission.
Negative behavior
Called by non-approved operator.
Called with zero address for
from
orto
.Called with too high commission.
Called with valid, positive commission but zero address for
serviceFeeRecipient
.