Skip to main content

AruviPaymentGateway

The core contract. Non-custodial: it moves allowlisted stablecoins directly between parties and records payment metadata.

Network: Arc Testnet (chain 5042002) · Solidity: 0.8.27 · Security: OpenZeppelin Ownable2Step, ReentrancyGuard, Pausable, SafeERC20

Payments

function send(address recipient, uint256 amount, string calldata memo)
external returns (bytes32 paymentId);

function sendToken(address recipient, address token, uint256 amount, string calldata memo)
external returns (bytes32 paymentId);

function multiSend(address[] calldata recipients, uint256[] calldata amounts, string calldata memo)
external returns (bytes32[] memory paymentIds);
  • amount uses the token's smallest unit (USDC: 6 decimals → 1_000_000 = $1)
  • send uses the default token (USDC); sendToken any allowlisted token (e.g. EURC)
  • multiSend supports 1-100 recipients with per-recipient amounts, atomically

Reverts: InvalidRecipient, CannotPaySelf, InvalidAmount, TokenNotSupported, InvalidBatch

Requests

function createRequest(uint256 amount, uint256 expiresIn, string calldata memo)
external returns (bytes32 requestId);

function createRequestToken(address token, uint256 amount, uint256 expiresIn, string calldata memo)
external returns (bytes32 requestId);

function fulfillRequest(bytes32 requestId, uint256 amount, string calldata memo)
external returns (bytes32 paymentId);

function cancelRequest(bytes32 requestId) external;
  • amount = 0 creates an open ("payer chooses") request; otherwise fulfillRequest must match exactly
  • expiresIn = 0 means never expires

Reverts: RequestNotFound, RequestAlreadyFulfilled, RequestExpired, AmountMismatch(expected, provided), NotRequester

Subscriptions

function createSubscription(address recipient, uint256 amount, uint256 interval)
external returns (bytes32 subscriptionId);

function executeSubscription(bytes32 subscriptionId) external returns (bytes32 paymentId);
function cancelSubscription(bytes32 subscriptionId) external;
  • interval minimum is 1 day (86400); first charge executable immediately
  • executeSubscription callable by subscriber or recipient when due
  • cancelSubscription callable by either party

Reverts: SubscriptionNotFound, SubscriptionNotActive, SubscriptionNotDue(nextPayment), NotSubscriptionParty, IntervalTooShort

Refunds

function refund(bytes32 paymentId) external;

Recipient-only, full amount, once. The gateway pulls the refund via transferFrom(recipient, sender, amount) - the recipient needs an active allowance.

Reverts: PaymentNotFound, AlreadyRefunded, NotRecipient

Views

function getPaymentInfo(bytes32 paymentId) external view returns (
address sender, address recipient, address token,
uint256 amount, uint256 timestamp, bool isRefunded);

function getRequestInfo(bytes32 requestId) external view returns (
address requester, address token, uint256 amount, uint256 createdAt,
uint256 expiresAt, bool fulfilled, bytes32 paymentId);

function getSubscriptionInfo(bytes32 subscriptionId) external view returns (
address subscriber, address recipient, address token, uint256 amount,
uint256 interval, uint256 nextPayment, bool active);

// Public mappings
function sentTotal(address account, address token) external view returns (uint256);
function receivedTotal(address account, address token) external view returns (uint256);
function paymentCount(address) external view returns (uint256);
function refunded(bytes32) external view returns (bool);
function supportedTokens(address) external view returns (bool);
function defaultToken() external view returns (address);

Admin (owner-only)

function setTokenSupport(address token, bool supported) external;  // cannot disable the default token
function setDefaultToken(address token) external; // must be supported
function rescueTokens(address token, address to, uint256 amount) external; // recover mistaken direct transfers
function pause() external; // blocks new payments only
function unpause() external;
function transferOwnership(address) external; // two-step (Ownable2Step)
function acceptOwnership() external;

See Events for the full event reference and Tokens for token addresses.