Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ps2-controller/aab3924cae72f611878d756ae7238111 to your computer and use it in GitHub Desktop.
Save ps2-controller/aab3924cae72f611878d756ae7238111 to your computer and use it in GitHub Desktop.
Fixed-Fee-CDP Market sample code
struct Offer {
// sorting information
uint next; // points to id of next higher offer
uint previous; // points to id of previous lower offer
// economic information
uint rate; // (minimum) fixed rate for which this offer is valid
uint amount; // amount of ether associated with this offer
address owner;
}
mapping(uint => Offer) public offers; // doubly linked list of sorted offer ids
uint public best; // head of offers
uint public worst; // tail of offers
uint nextId = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment