Skip to main content

ExchangeReleaser

Git Source

Inherits: IReleaser, ResourceManager, Nonce

A contract that releases assets from an TokenJar in exchange for transferring a threshold amount of a resource token

Inherits from ResourceManager for resource transferring functionality and Nonce for replay protection

Note: security-contact: security@uniswap.org

State Variables

TOKEN_JAR

ITokenJar public immutable TOKEN_JAR

Functions

constructor

Creates a new ExchangeReleaser instance

constructor(address _resource, uint256 _threshold, address _tokenJar, address _recipient)
ResourceManager(_resource, _threshold, msg.sender, _recipient);

Parameters

NameTypeDescription
_resourceaddressThe address of the resource token that must be transferred
_thresholduint256
_tokenJaraddressThe address of the TokenJar contract holding the assets
_recipientaddressThe address that will receive the resource tokens

release

Releases assets to a specified recipient if the resource threshold is met

function release(uint256 _nonce, Currency[] calldata assets, address recipient) external virtual;

Parameters

NameTypeDescription
_nonceuint256The nonce for the release, must equal to the contract nonce otherwise revert
assetsCurrency[]The list of assets (addresses) to release, which may have length limits Native tokens (Ether) are represented as the zero address
recipientaddressThe address to receive the released assets, paid out by Token Jar

_release

Internal function to handle the nonce check, transfer the RESOURCE, and call the release of assets on the TokenJar.

function _release(uint256 _nonce, Currency[] calldata assets, address recipient)
internal
handleNonce(_nonce);