AiderDocs
Open app

Reference

Contract reference

Addresses, constants, every function, view and event of the Aider contract.

Source
contracts/Aider.sol
Solidity
0.8.28
USDC
0x3600…0000 (ERC-20, 6 decimals)
Upgradeable
No

Addresses

NetworkAddressNotes
Arc Testnet (5042002)0xed32e15d81e7864bf19caea4333bd0781f328ba3Version 1 (deployed as Leash), deploy block 69187895
Arc mainnet (5042)0xaeb8bf4852d4a6ad0fe75d488b418cae664653e9Version 2, deploy block 28199868

Constants

NameValue
USDC_TOKEN0x3600000000000000000000000000000000000000
MAX_REQUEST_TTL (v2)7 days
MAX_OPEN_REQUESTS_PER_AGENT (v2)10

Owner functions

FunctionWhat it doesCan revert with
createWallet() → walletIdCreates a wallet owned by the caller (anyone can call it).—
deposit(walletId, amount)Pulls USDC from the owner into the wallet. Approve the contract on USDC first.NotWalletOwner, ZeroAmount
withdraw(walletId, amount)Sends available USDC to the owner. Works while paused.NotWalletOwner, ZeroAmount, InsufficientBalance
pauseWallet(walletId, paused)Stops or resumes every agent.NotWalletOwner
addAgent(walletId, agent, label, perPaymentLimit, dailyLimit, expiresAt)Adds, re-enables or relabels an agent; keeps today's spend in v2. expiresAt 0 = never.NotWalletOwner, ZeroAddress, OwnerCannotBeAgent (v2), InvalidExpiry (v2)
updateAgent(walletId, agent, perPaymentLimit, dailyLimit, expiresAt)Changes limits and expiry. Doesn't re-enable.NotWalletOwner, ZeroAddress, AgentNotActive, InvalidExpiry (v2)
revokeAgent(walletId, agent)Revokes at once; voids its open requests in v2.NotWalletOwner, ZeroAddress, AgentNotActive (v2)
setRecipientMode(walletId, mode)0 anyone, 1 allowlist only.NotWalletOwner
setAllowlist(walletId, recipient, allowed)Edits the allowlist.NotWalletOwner
setBlocklist(walletId, recipient, blocked)Edits the blocklist.NotWalletOwner
approveRequest(requestId)Pays a pending request.RequestNotFound (v2), RequestNotPending, NotWalletOwner, RequestExpiredError, AgentRevokedError (v2), AgentExpired (v2), RecipientBlocked, RecipientNotAllowed
rejectRequest(requestId)Rejects and releases a pending request.RequestNotFound (v2), RequestNotPending, NotWalletOwner
rejectRequests(requestIds) → count (v2)Rejects many; skips ones that aren't pending.RequestNotFound, NotWalletOwner

Agent functions

FunctionWhat it doesCan revert with
agentPay(walletId, to, amount, memo)Pays within the limits. See agent payments for the order of checks.AgentNotActive, AgentRevokedError, AgentExpired, WalletPaused, ZeroAddress, InvalidRecipient (v2), ZeroAmount, RecipientBlocked, RecipientNotAllowed, OverPerPaymentLimit, OverDailyLimit, InsufficientBalance
requestPayment(walletId, to, amount, memo, ttlSeconds) → requestIdReserves the amount and asks the owner.the agent and recipient checks above, InvalidTTL, TooManyOpenRequests (v2), InsufficientBalance

Anyone

FunctionWhat it doesCan revert with
expireRequest(requestId)Releases a request after its TTL, or at once if its agent was revoked or expired (v2).RequestNotFound (v2), RequestNotPending, RequestNotExpiredYet
expireRequests(requestIds) → count (v2)Releases many; skips ones that can't be released yet.RequestNotFound

Views

ViewReturns
getWallet(walletId)owner, balance, reserved, available, paused, mode
getAgent(walletId, agent)label, perPaymentLimit, dailyLimit, expiresAt, active, spentToday, dayStart (v2 resets spentToday to 0 after a UTC rollover; v1 returns the stored value)
getRequest(requestId)walletId, agent, to, amount, memo, expiresAt, status (0 pending, 1 approved, 2 rejected, 3 expired; unknown ids have agent = 0x0)
getRequestState(requestId) (v2)status, approvable, releasable
getPendingRequests(walletId)Ids stored as pending, including ones past their TTL that nobody released. Order not guaranteed.
openRequestCount(walletId, agent) (v2)How many requests the agent has open
nextWalletId(), nextRequestId()The next ids to be used
isAllowlisted, isBlocklisted, isRecipientPermittedRecipient checks for a wallet

Events are listed in watching activity.

v1 and v2

Version 2 keeps every v1 function, event and error unchanged and adds:

Changev1 (deployed on testnet)v2 (in the repo)
Paying the contract or the USDC tokenAllowed; the USDC gets stuckInvalidRecipient
Re-adding an agent the same dayResets today's spendKeeps today's spend
Requests of a revoked or expired agentStill approvableVoided; anyone can release them
Request TTLAny lengthUp to 7 days
Open requests per agentUnlimited10
Owner as agent, past expiryAllowedOwnerCannotBeAgent, InvalidExpiry
Unknown request idsLook pendingRequestNotFound
getAgent().spentToday after midnightStale0
Batch reject/release, getRequestState—Added

Next

Look up terms in the glossary.

Built with Arc Studio