Creating & Updating offers
How to write Mangrovian offers
Posting a new offer
function newOffer(
address outboundTkn,
address inboundTkn,
uint wants, // amount of inbound Tokens
uint gives, // amount of outbound Tokens
uint gasreq,
uint gasprice,
uint pivotId
) external payable returns (uint offerId);// logging new offer's data
event OfferWrite(
address outboundTkn,
address inboundTkn,
address maker, // account that created the offer, will be called upon execution
uint wants,
uint gives,
uint gasprice, // gasprice that was used to compute the offer bounty
uint gasreq,
uint offerId, // id of the new offer
uint prev // offer id of the closest best offer at the time of insertion
);
// `maker` balance on Mangrove (who is `msg.sender`) is debited of `amount` WEIs to provision the offer
event DebitWei(address maker, uint amount);
// `maker` balance on Mangrove is credited of `amount` WEIs if `msg.value > 0`.
event CreditWei(address maker, uint amount); Updating an existing offer
Inputs
Outputs
Retracting an offer
Inputs
Outputs
Last updated
Was this helpful?