Marketplace Facet

Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.

The Marketplace Facet handles logic for buying and selling Pods on the Pod Market.

Call Functions

function createPodListing(
    uint256 index,
    uint256 start,
    uint256 amount,
    uint24 pricePerPod,
    uint256 maxHarvestableIndex,
    uint256 minFillAmount,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

pricePerPod

uint24

WIP

maxHarvestableIndex

uint256

WIP

minFillAmount

uint256

WIP

mode

To

WIP

function createPodListingV2(
    uint256 index,
    uint256 start,
    uint256 amount,
    uint256 maxHarvestableIndex,
    uint256 minFillAmount,
    bytes calldata pricingFunction,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

maxHarvestableIndex

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

mode

To

WIP

function fillPodListing(
    PodListing calldata l,
    uint256 beanAmount,
    LibTransfer.From mode
) external payable;

WIP

ParameterTypeDescription

l

PodListing

WIP

beanAmount

uint256

WIP

mode

From

WIP

function fillPodListingV2(
    PodListing calldata l,
    uint256 beanAmount,
    bytes calldata pricingFunction,
    LibTransfer.From mode
) external payable;

WIP

ParameterTypeDescription

l

PodListing

WIP

beanAmount

uint256

WIP

pricingFunction

bytes

WIP

mode

From

WIP

function cancelPodListing(uint256 index) external payable;

WIP

ParameterTypeDescription

index

uint256

WIP

function createPodOrder(
    uint256 beanAmount,
    uint24 pricePerPod,
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    LibTransfer.From mode
) external payable returns (bytes32 id);

WIP

ParameterTypeDescription

beanAmount

uint256

WIP

pricePerPod

uint24

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

mode

From

WIP

Return ValueTypeDescription

id

bytes32

WIP

function createPodOrderV2(
    uint256 beanAmount,
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    bytes calldata pricingFunction,
    LibTransfer.From mode
) external payable returns (bytes32 id);
ParameterTypeDescription

beanAmount

uint256

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

mode

From

WIP

Return ValueTypeDescription

id

bytes32

WIP

function fillPodOrder(
    PodOrder calldata o,
    uint256 index,
    uint256 start,
    uint256 amount,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

o

PodOrder

WIP

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

mode

To

WIP

function fillPodOrderV2(
    PodOrder calldata o,
    uint256 index,
    uint256 start,
    uint256 amount,
    bytes calldata pricingFunction,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

o

PodOrder

WIP

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

pricingFunction

bytes

WIP

mode

To

WIP

function cancelPodOrder(
    uint24 pricePerPod,
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

pricePerPod

uint24

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

mode

To

WIP

function cancelPodOrderV2(
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    bytes calldata pricingFunction,
    LibTransfer.To mode
) external payable;

WIP

ParameterTypeDescription

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

mode

To

WIP

function transferPlot(
    address sender,
    address recipient,
    uint256 id,
    uint256 start,
    uint256 end
) external payable nonReentrant;

WIP

ParameterTypeDescription

sender

address

WIP

recipient

address

WIP

id

uint256

WIP

start

uint256

WIP

end

uint256

WIP

function approvePods(address spender, uint256 amount)
    external
    payable
    nonReentrant;

WIP

ParameterTypeDescription

spender

address

WIP

amount

uint256

WIP

function getAmountPodsFromFillListingV2(
    uint256 placeInLine, 
    uint256 podListingAmount,
    uint256 fillBeanAmount,
    bytes calldata pricingFunction
) public pure returns (uint256 amount);

WIP

ParameterTypeDescription

placeInLine

uint256

WIP

podListingAmount

uint256

WIP

fillBeanAmount

uint256

WIP

pricingFunction

bytes

WIP

Return ValueTypeDescription

amount

uint256

WIP

function getAmountBeansToFillOrderV2(
    uint256 placeInLine, 
    uint256 amountPodsFromOrder,
    bytes calldata pricingFunction
) public pure returns (uint256 beanAmount);

WIP

ParameterTypeDescription

placeInLine

uint256

WIP

amountPodsFromOrder

uint256

WIP

pricingFunction

bytes

WIP

Return ValueTypeDescription

beanAmount

uint256

WIP

View Functions

function podOrder(
    address account,
    uint24 pricePerPod,
    uint256 maxPlaceInLine,
    uint256 minFillAmount
) external view returns (uint256);

WIP

ParameterTypeDescription

account

address

WIP

pricePerPod

uint24

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

Return ValueDescription

uint256

WIP

function podOrderV2(
    address account,
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    bytes calldata pricingFunction
) external view returns (uint256);

WIP

ParameterTypeDescription

account

address

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

Return TypeDescription

uint256

WIP

function podOrderById(bytes32 id) external view returns (uint256);

WIP

ParameterTypeDescription

id

bytes32

WIP

Return TypeDescription

uint256

WIP

function podListing(uint256 index) external view returns (bytes32);

WIP

ParameterTypeDescription

index

uint256

WIP

Return TypeDescription

bytes32

WIP

function allowancePods(address owner, address spender)
    public
    view
    returns (uint256);

WIP

ParameterTypeDescription

owner

address

WIP

spender

address

WIP

Return TypeDescription

uint256

WIP

Events

event PodListingCreated(
    address indexed account, 
    uint256 index, 
    uint256 start, 
    uint256 amount, 
    uint24 pricePerPod, 
    uint256 maxHarvestableIndex, 
    uint256 minFillAmount,
    bytes pricingFunction,
    LibTransfer.To mode,
    LibPolynomial.PriceType pricingType
);

WIP

ParameterTypeDescription

account

address

WIP

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

pricePerPod

uint24

WIP

maxHarvestableIndex

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

mode

To

WIP

pricingType

PriceType

WIP

event PodListingFilled(
    address indexed from,
    address indexed to,
    uint256 index,
    uint256 start,
    uint256 amount,
    uint256 costInBeans
);

WIP

ParameterTypeDescription

from

address

WIP

to

address

WIP

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

costInBeans

uint256

WIP

event PodListingCancelled(address indexed account, uint256 index);

WIP

ParameterTypeDescription

account

address

WIP

index

uint256

WIP

event PodOrderCreated(
    address indexed account,
    bytes32 id,
    uint256 amount,
    uint24 pricePerPod,
    uint256 maxPlaceInLine,
    uint256 minFillAmount,
    bytes pricingFunction,
    LibPolynomial.PriceType priceType
);

WIP

ParameterTypeDescription

account

address

WIP

id

bytes32

WIP

amount

uint256

WIP

pricePerPod

uint24

WIP

maxPlaceInLine

uint256

WIP

minFillAmount

uint256

WIP

pricingFunction

bytes

WIP

priceType

PriceType

WIP

event PodOrderFilled(
    address indexed from,
    address indexed to,
    bytes32 id,
    uint256 index,
    uint256 start,
    uint256 amount,
    uint256 costInBeans
);

WIP

ParameterTypeDescription

from

address

WIP

to

address

WIP

id

bytes32

WIP

index

uint256

WIP

start

uint256

WIP

amount

uint256

WIP

costInBeans

uint256

WIP

event PodOrderCancelled(address indexed account, bytes32 id);

WIP

ParameterTypeDescription

account

address

WIP

id

bytes32

WIP

event PlotTransfer(
    address indexed from,
    address indexed to,
    uint256 indexed id,
    uint256 pods
);

WIP

ParameterTypeDescription

from

address

WIP

to

address

WIP

id

uint256

WIP

pods

uint256

WIP

event PodApproval(
    address indexed owner,
    address indexed spender,
    uint256 pods
);

WIP

ParameterTypeDescription

owner

address

WIP

spender

address

WIP

pods

uint256

WIP

Last updated