Skip to content

Latest commit

 

History

History
193 lines (129 loc) · 3.5 KB

IVoucherHub.md

File metadata and controls

193 lines (129 loc) · 3.5 KB

Solidity API

IVoucherHub

VoucherType

struct VoucherType {
  string description;
  uint256 duration;
}

VoucherTypeCreated

event VoucherTypeCreated(uint256 id, string description, uint256 duration)

VoucherTypeDescriptionUpdated

event VoucherTypeDescriptionUpdated(uint256 id, string description)

VoucherTypeDurationUpdated

event VoucherTypeDurationUpdated(uint256 id, uint256 duration)

EligibleAssetAdded

event EligibleAssetAdded(uint256 id, address asset)

EligibleAssetRemoved

event EligibleAssetRemoved(uint256 id, address asset)

VoucherCreated

event VoucherCreated(address voucher, address owner, uint256 voucherType, uint256 expiration, uint256 value)

VoucherToppedUp

event VoucherToppedUp(address voucher, uint256 expiration, uint256 value)

VoucherDebited

event VoucherDebited(address voucher, uint256 sponsoredAmount)

VoucherRefunded

event VoucherRefunded(address voucher, uint256 amount)

VoucherDrained

event VoucherDrained(address voucher, uint256 amount)

createVoucherType

function createVoucherType(string description, uint256 duration) external

updateVoucherTypeDescription

function updateVoucherTypeDescription(uint256 id, string description) external

updateVoucherTypeDuration

function updateVoucherTypeDuration(uint256 id, uint256 duration) external

addEligibleAsset

function addEligibleAsset(uint256 voucherTypeId, address asset) external

removeEligibleAsset

function removeEligibleAsset(uint256 voucherTypeId, address asset) external

createVoucher

function createVoucher(address owner, uint256 voucherType, uint256 value) external returns (address voucherAddress)

topUpVoucher

function topUpVoucher(address voucher, uint256 value) external

debitVoucher

function debitVoucher(uint256 voucherTypeId, address app, uint256 appPrice, address dataset, uint256 datasetPrice, address workerpool, uint256 workerpoolPrice, uint256 volume) external returns (uint256 sponsoredAmount)

refundVoucher

function refundVoucher(uint256 amount) external

drainVoucher

function drainVoucher(address voucher) external

withdraw

function withdraw(address receiver, uint256 amount) external

getIexecPoco

function getIexecPoco() external view returns (address)

getVoucherBeacon

function getVoucherBeacon() external view returns (address)

getVoucherProxyCodeHash

function getVoucherProxyCodeHash() external view returns (bytes32)

getVoucherType

function getVoucherType(uint256 id) external view returns (struct IVoucherHub.VoucherType)

getVoucherTypeCount

function getVoucherTypeCount() external view returns (uint256)

isAssetEligibleToMatchOrdersSponsoring

function isAssetEligibleToMatchOrdersSponsoring(uint256 voucherTypeId, address asset) external view returns (bool)

isVoucher

function isVoucher(address account) external view returns (bool)

getVoucher

function getVoucher(address owner) external view returns (address)

predictVoucher

function predictVoucher(address owner) external view returns (address)