📑Solidity API Docs
Event, Struct, State, and Function definitions
Solidity API
Ramp
AccountRegistered
DepositReceived
IntentSignaled
IntentPruned
IntentFulfilled
DepositWithdrawn
DepositClosed
UserAddedToDenylist
UserRemovedFromDenylist
MinDepositAmountSet
MaxOnRampAmountSet
IntentExpirationPeriodSet
OnRampCooldownPeriodSet
SustainabilityFeeUpdated
SustainabilityFeeRecipientUpdated
NewSendProcessorSet
NewRegistrationProcessorSet
NewReceiveProcessorSet
AccountInfo
Deposit
DepositWithAvailableLiquidity
Intent
IntentWithOnRamperId
DenyList
GlobalAccountInfo
onlyRegisteredUser
PRECISE_UNIT
MAX_DEPOSITS
CIRCOM_PRIME_FIELD
MAX_SUSTAINABILITY_FEE
usdc
poseidon
registrationProcessor
sendProcessor
isInitialized
globalAccount
accounts
deposits
intents
minDepositAmount
maxOnRampAmount
onRampCooldownPeriod
intentExpirationPeriod
sustainabilityFee
sustainabilityFeeRecipient
depositCounter
constructor
initialize
Initialize Ramp with the addresses of the Processors
Parameters
register
Registers a new account by pulling the hash of the account id from the proof and assigning the account owner to the sender of the transaction. One venmo account can be registered to multiple Ethereum addresses.
Parameters
offRamp
Generates a deposit entry for off-rampers that can then be fulfilled by an on-ramper. This function will not add to previous deposits. Every deposit has it's own unique identifier. User must approve the contract to transfer the deposit amount of USDC.
Parameters
signalIntent
Signals intent to pay the depositor defined in the _depositId the _amount * deposit conversionRate off-chain in order to unlock _amount of funds on-chain. Each user can only have one outstanding intent at a time regardless of address (tracked using venmoId). Caller must not be on the depositor's deny list. If there are prunable intents then they will be deleted from the deposit to be able to maintain state hygiene.
Parameters
cancelIntent
Only callable by the originator of the intent. Cancels an outstanding intent thus allowing user to signal a new intent. Deposit state is updated to reflect the cancelled intent.
Parameters
onRamp
Anyone can submit an on-ramp transaction, even if caller isn't on-ramper. Upon submission the proof is validated, intent is removed, and deposit state is updated. USDC is transferred to the on-ramper.
Parameters
withdrawDeposit
Caller must be the depositor for each depositId in the array, if not whole function fails. Depositor is returned all remaining deposits and any outstanding intents that are expired. If an intent is not expired then those funds will not be returned. Deposit will be deleted as long as there are no more outstanding intents.
Parameters
addAccountToDenylist
Adds a venmoId to a depositor's deny list. If an address associated with the banned venmoId attempts to signal an intent on the user's deposit they will be denied.
Parameters
removeAccountFromDenylist
Removes a venmoId from a depositor's deny list.
Parameters
setSendProcessor
GOVERNANCE ONLY: Updates the send processor address used for validating and interpreting zk proofs.
Parameters
setRegistrationProcessor
GOVERNANCE ONLY: Updates the registration processor address used for validating and interpreting zk proofs.
Parameters
setMinDepositAmount
GOVERNANCE ONLY: Updates the minimum deposit amount a user can specify for off-ramping.
Parameters
setSustainabilityFee
GOVERNANCE ONLY: Updates the sustainability fee. This fee is charged to on-rampers upon a successful on-ramp.
Parameters
setSustainabilityFeeRecipient
GOVERNANCE ONLY: Updates the recepient of sustainability fees.
Parameters
setMaxOnRampAmount
GOVERNANCE ONLY: Updates the max amount allowed to be on-ramped in each transaction. To on-ramp more than this amount a user must make multiple transactions.
Parameters
setOnRampCooldownPeriod
GOVERNANCE ONLY: Updates the on-ramp cooldown period, once an on-ramp transaction is completed the user must wait this amount of time before they can signalIntent to on-ramp again.
Parameters
setIntentExpirationPeriod
GOVERNANCE ONLY: Updates the intent expiration period, after this period elapses an intent can be pruned to prevent locking up a depositor's funds.
Parameters
getDeposit
getAccountInfo
getVenmoIdCurrentIntentHash
getLastOnRampTimestamp
getDeniedUsers
isDeniedUser
getIntentsWithOnRamperId
getAccountDeposits
getDepositFromIds
_calculateIntentHash
Calculates the intentHash of new intent
_getPrunableIntents
Cycles through all intents currently open on a deposit and sees if any have expired. If they have expired the outstanding amounts are summed and returned alongside the intentHashes
_pruneIntents
_pruneIntent
Pruning an intent involves deleting its state from the intents mapping, zeroing out the intendee's currentIntentHash in their global account mapping, and deleting the intentHash from the deposit's intentHashes array.
_closeDepositIfNecessary
Removes a deposit if no outstanding intents AND no remaining deposits. Deleting a deposit deletes it from the deposits mapping and removes tracking it in the user's accounts mapping.
_transferFunds
Checks if sustainability fee has been defined, if so sends fee to the fee recipient and intent amount minus fee to the on-ramper. If sustainability fee is undefined then full intent amount is transferred to on-ramper.
_verifyOnRampProof
Validate venmo send payment email and check that it hasn't already been used (done on SendProcessor). Additionally, we validate that the offRamperIdHash matches the one from the specified intent and that enough was paid off-chain inclusive of the conversionRate.
_verifyRegistrationProof
Validate the user has a venmo account, we do not nullify this email since it can be reused to register under different addresses.
IRegistrationProcessor
RegistrationProof
processProof
ISendProcessor
SendProof
processProof
BaseProcessor
onlyRamp
ramp
mailserverKeyHashAdapter
nullifierRegistry
emailFromAddress
constructor
setMailserverKeyHashAdapter
setEmailFromAddress
ONLY OWNER: Sets the from email address for validated emails. Check that email address is properly padded (if necessary). Padding will be dependent on if unpacking functions cut trailing 0s or not.
Parameters
getEmailFromAddress
getMailserverKeyHash
_validateAndAddNullifier
VenmoRegistrationProcessor
constructor
processProof
_parseSignalArray
VenmoSendProcessor
constructor
processProof
_parseSignalArray
ManagedKeyHashAdapter
mailserverKeyHash
constructor
setMailserverKeyHash
NullifierRegistry
NullifierAdded
WriterAdded
WriterRemoved
onlyWriter
isNullified
isWriter
writers
constructor
addNullifier
ONLY WRITER: Only addresses with permission to write to this contract can call. Stores a nullifier for an email.
Parameters
addWritePermission
ONLY OWNER: Add address that has write permissions to the registry. Writer must not have been previously added.
Parameters
removeWritePermission
ONLY OWNER: Remove address that has write permissions to the registry. Writer must have been previously added.
Parameters
getWriters
Last updated