Skip to content

Bug report in simple-marketplace smart contract #281

Description

As documented by its following specification, AcceptOffer is only available when at OfferPlaced state.

{
"Name": "OfferPlaced",
"DisplayName": "Offer Placed",
"Description": "Offer has been placed for the item",
"PercentComplete": 60,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [ ],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Accept the proposed offer for the item",
"Function": "AcceptOffer",
"NextStates": [ "Accepted" ],
"DisplayName": "Accept Offer"
},
{
"AllowedRoles": [ ],
"AllowedInstanceRoles": [ "InstanceOwner" ],
"Description": "Reject the proposed offer for the item",
"Function": "Reject",
"NextStates": [ "ItemAvailable" ],
"DisplayName": "Reject"
}
]
},

  • Bug repair.
    We can fix such bug by adding statements:
    function AcceptOffer() public
    {
        // Fix
        if ( State != StateType.OfferPlaced ){
            revert();
        }
        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions