Skip to main content
deleted 30 characters in body
Source Link
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].offerings.proposed.amount will give you the amount proposed by the user with address A.

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

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

Hope this helps.

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].offerings.proposed.amount will give you the amount proposed by the user with address A.

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

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

Hope this helps.

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.

added 376 characters in body
Source Link
Jaime
  • 8.4k
  • 1
  • 12
  • 20

In your design, every address has proposed, received, accepted and rejected which are uint256. Then you can have a structure with these numbers for each address:

struct param {
    uint256 amount;
    uint256 percentageBonus;
}

struct offerings {
    uint256[2]param proposed;
    uint256[2]param received;
    uint256[2]param accepted;
    uint256[2]param rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to his owna 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 datauser address is A:

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

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

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

Hope this helps.

In your design, every address has proposed, received, accepted and rejected which are uint256. Then you can have a structure with these numbers for each address:

struct offerings {
    uint256[2] proposed;
    uint256[2] received;
    uint256[2] accepted;
    uint256[2] rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to his own structure with the data.

Hope this helps.

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].offerings.proposed.amount will give you the amount proposed by the user with address A.

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

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

Hope this helps.

added 4 characters in body
Source Link
Jaime
  • 8.4k
  • 1
  • 12
  • 20

In your design, every address has proposed, received, accepted and rejected which are uint256. Then you can have a structure with these numbers for each address:

struct offerings {
    uint256[]uint256[2] proposed;
    uint256[]uint256[2] received;
    uint256[]uint256[2] accepted;
    uint256[]uint256[2] rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to his own structure with the data.

Hope this helps.

In your design, every address has proposed, received, accepted and rejected which are uint256. Then you can have a structure with these numbers for each address:

struct offerings {
    uint256[] proposed;
    uint256[] received;
    uint256[] accepted;
    uint256[] rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to his own structure with the data.

Hope this helps.

In your design, every address has proposed, received, accepted and rejected which are uint256. Then you can have a structure with these numbers for each address:

struct offerings {
    uint256[2] proposed;
    uint256[2] received;
    uint256[2] accepted;
    uint256[2] rejected;
}

mapping(address => offerings) public offeringData;

Like this, you will be mapping each address to his own structure with the data.

Hope this helps.

added 12 characters in body
Source Link
Jaime
  • 8.4k
  • 1
  • 12
  • 20
Loading
Source Link
Jaime
  • 8.4k
  • 1
  • 12
  • 20
Loading