Skip to content

Instantly share code, notes, and snippets.

@ac12644
Last active January 17, 2022 07:53
Show Gist options
  • Save ac12644/8a974202e310f98f749f46ff9078c995 to your computer and use it in GitHub Desktop.
Save ac12644/8a974202e310f98f749f46ff9078c995 to your computer and use it in GitHub Desktop.
contract AuctionRepository {
// Array with all auctions
Auction[] public auctions;
// Mapping from auction index to user bids
mapping(uint256 => Bid[]) public auctionBids;
// Mapping from owner to a list of owned auctions
mapping(address => uint[]) public auctionOwner;
// Bid struct to hold bidder and amount
struct Bid {
address from;
uint256 amount;
}
// Auction struct which holds all the required info
struct Auction {
string name;
uint256 blockDeadline;
uint256 startPrice;
string metadata;
uint256 deedId;
address deedRepositoryAddress;
address owner;
bool active;
bool finalized;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment