Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report in simple-marketplace smart contract #281

Open
academic-starter opened this issue Feb 22, 2024 · 0 comments
Open

Bug report in simple-marketplace smart contract #281

academic-starter opened this issue Feb 22, 2024 · 0 comments

Comments

@academic-starter
Copy link

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();
        }
        ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant