Skip to main content
5 of 5
deleted 30 characters in body
Jaime
  • 8.4k
  • 1
  • 12
  • 20
struct param {
    uint256 amount;
    uint256 percentageBonus;
}

struct offerings {
    param proposed;
    param received;
    param accepted;
    param rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to a structure with four fields (proposed, received... etc) each of these fields have two fields (amount and percentageBonus)

you can use it like this, assume the user address is A:

offeringData[A].proposed.amount will give you the amount proposed by the user with address A.

offeringData[A].proposed.percentageBonus give you the percentage bonus. Same for the other variables.

You can set these doing, for instance,: offeringData[A].proposed.amount = value

Hope this helps.

Jaime
  • 8.4k
  • 1
  • 12
  • 20