Refund Escrow

RefundEscrow

Escrow that holds funds for a beneficiary, deposited from multiple parties.Intended usage: See {Escrow}. Same usage guidelines apply here.The owner account (that is, the contract that instantiates this contract) may deposit, close the deposit period, and allow for either withdrawal by the beneficiary, or refunds to the depositors. All interactions with RefundEscrow will be made through the owner contract.

Methods

beneficiary

function beneficiary() external view returns (address payable)

Returns

NameTypeDescription

_0

address payable

The beneficiary of the escrow.

beneficiaryWithdraw

function beneficiaryWithdraw() external nonpayable

Withdraws the beneficiary's funds.

close

function close() external nonpayable

Allows for the beneficiary to withdraw their funds, rejecting further deposits.

deposit

function deposit(address refundee) external payable

Stores funds that may later be refunded.

Parameters

NameTypeDescription

refundee

address

The address funds will be sent to if a refund occurs.

depositsOf

function depositsOf(address payee) external view returns (uint256)

Parameters

NameTypeDescription

payee

address

undefined

Returns

NameTypeDescription

_0

uint256

undefined

enableRefunds

function enableRefunds() external nonpayable

Allows for refunds to take place, rejecting further deposits.

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription

_0

address

undefined

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

state

function state() external view returns (enum RefundEscrow.State)

Returns

NameTypeDescription

_0

enum RefundEscrow.State

The current state of the escrow.

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription

newOwner

address

undefined

withdraw

function withdraw(address payable payee) external nonpayable

Withdraw accumulated balance for a payee, forwarding all gas to the recipient. WARNING: Forwarding all gas opens the door to reentrancy vulnerabilities. Make sure you trust the recipient, or are either following the checks-effects-interactions pattern or using {ReentrancyGuard}.

Parameters

NameTypeDescription

payee

address payable

The address whose funds will be withdrawn and transferred to.

withdrawalAllowed

function withdrawalAllowed(address) external view returns (bool)

Returns whether refundees can withdraw their deposits (be refunded). The overridden function receives a 'payee' argument, but we ignore it here since the condition is global, not per-payee.

Parameters

NameTypeDescription

_0

address

undefined

Returns

NameTypeDescription

_0

bool

undefined

Events

Deposited

event Deposited(address indexed payee, uint256 weiAmount)

Parameters

NameTypeDescription

payee indexed

address

undefined

weiAmount

uint256

undefined

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription

previousOwner indexed

address

undefined

newOwner indexed

address

undefined

RefundsClosed

event RefundsClosed()

RefundsEnabled

event RefundsEnabled()

Withdrawn

event Withdrawn(address indexed payee, uint256 weiAmount)

Parameters

NameTypeDescription

payee indexed

address

undefined

weiAmount

uint256

undefined

Last updated