-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from multiversx/marketplace-with-offer-feature
marketplace with offer feature
- Loading branch information
Showing
13 changed files
with
1,118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"name": "offer token", | ||
"gasSchedule": "v4", | ||
"steps": [ | ||
{ | ||
"step": "externalSteps", | ||
"path": "init.scen.json" | ||
}, | ||
{ | ||
"step": "setState", | ||
"comment": "set current block timestamp", | ||
"currentBlockInfo": { | ||
"blockTimestamp": "123,000" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "offer token error", | ||
"tx": { | ||
"from": "address:first_bidder", | ||
"to": "sc:marketplace", | ||
"value": "10", | ||
"function": "sendOffer", | ||
"arguments": [ | ||
"str:NFT-123456", | ||
"1", | ||
"1", | ||
"123,000", | ||
"0" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "4", | ||
"message": "str:Deadline can't be in the past!", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "offer token success", | ||
"tx": { | ||
"from": "address:first_bidder", | ||
"to": "sc:marketplace", | ||
"value": "10", | ||
"function": "sendOffer", | ||
"arguments": [ | ||
"str:NFT-123456", | ||
"1", | ||
"1", | ||
"125,000" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "0", | ||
"message": "", | ||
"out": [ "1" ], | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:seller": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
}, | ||
"str:SFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "10", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"address:first_bidder": { | ||
"nonce": "2", | ||
"balance": "990", | ||
"storage": {} | ||
}, | ||
"sc:marketplace": { | ||
"nonce": "0", | ||
"balance": "10", | ||
"storage": { | ||
"str:bidCutPercentage": "1000", | ||
"str:lastValidOfferId": "1", | ||
"str:offerById|u64:1": { | ||
"01-offer_token": "nested:str:NFT-123456|u64:1|biguint:1", | ||
"01-payment": "nested:str:EGLD|u64:0|biguint:10", | ||
"04-start_time": "u64:123,000", | ||
"05-deadline": "u64:125,000", | ||
"06-offer_owner": "address:first_bidder" | ||
} | ||
}, | ||
"code": "file:../output/esdt-nft-marketplace.wasm" | ||
}, | ||
"+": {} | ||
} | ||
} | ||
] | ||
} |
109 changes: 109 additions & 0 deletions
109
esdt-nft-marketplace/mandos/offer_token_accept.scen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"name": "offer token", | ||
"gasSchedule": "v4", | ||
"steps": [ | ||
{ | ||
"step": "externalSteps", | ||
"path": "offer_token.scen.json" | ||
}, | ||
{ | ||
"step": "setState", | ||
"comment": "set current block timestamp", | ||
"currentBlockInfo": { | ||
"blockTimestamp": "124,500" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "offer token success", | ||
"tx": { | ||
"from": "address:seller", | ||
"to": "sc:marketplace", | ||
"value": "0", | ||
"function": "acceptOffer", | ||
"esdt": { | ||
"tokenIdentifier": "str:NFT-123456", | ||
"nonce": "1", | ||
"value": "1" | ||
}, | ||
"arguments": [ | ||
"1" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "0", | ||
"message": "", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:seller": { | ||
"nonce": "1", | ||
"balance": "7", | ||
"esdt": { | ||
"str:SFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "10", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"address:first_bidder": { | ||
"nonce": "2", | ||
"balance": "990", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"address:owner": { | ||
"nonce": "1", | ||
"balance": "1", | ||
"storage": {} | ||
}, | ||
"address:nft_creator": { | ||
"nonce": "0", | ||
"balance": "2", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"roles": [ | ||
"ESDTRoleNFTCreate" | ||
] | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"sc:marketplace": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"storage": { | ||
"str:bidCutPercentage": "1000", | ||
"str:lastValidOfferId": "1" | ||
}, | ||
"code": "file:../output/esdt-nft-marketplace.wasm" | ||
}, | ||
"+": {} | ||
} | ||
} | ||
] | ||
} |
152 changes: 152 additions & 0 deletions
152
esdt-nft-marketplace/mandos/offer_token_with_active_auction_bid_after_offer.scen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
{ | ||
"name": "auction token", | ||
"gasSchedule": "v4", | ||
"steps": [ | ||
{ | ||
"step": "externalSteps", | ||
"path": "auction_token.scen.json" | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "offer token success", | ||
"tx": { | ||
"from": "address:first_bidder", | ||
"to": "sc:marketplace", | ||
"value": "10", | ||
"function": "sendOffer", | ||
"arguments": [ | ||
"str:NFT-123456", | ||
"1", | ||
"1", | ||
"125,000", | ||
"1" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "0", | ||
"message": "", | ||
"out": [ "1" ], | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "first bid", | ||
"tx": { | ||
"from": "address:first_bidder", | ||
"to": "sc:marketplace", | ||
"value": "100", | ||
"function": "bid", | ||
"arguments": [ | ||
"1", | ||
"str:NFT-123456", | ||
"1" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "0", | ||
"message": "", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"txId": "withdraw and accept", | ||
"tx": { | ||
"from": "address:seller", | ||
"to": "sc:marketplace", | ||
"value": "0", | ||
"function": "withdrawAuctionAndAcceptOffer", | ||
"arguments": [ | ||
"1", | ||
"1" | ||
], | ||
"gasLimit": "15,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"status": "4", | ||
"message": "str:NFT auction has active bids", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:seller": { | ||
"nonce": "2", | ||
"balance": "0", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"instances": [] | ||
}, | ||
"str:SFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "10", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": {} | ||
}, | ||
"sc:marketplace": { | ||
"nonce": "0", | ||
"balance": "110", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1", | ||
"creator": "address:nft_creator", | ||
"royalties": "2000" | ||
} | ||
] | ||
} | ||
}, | ||
"storage": { | ||
"str:bidCutPercentage": "1000", | ||
"str:lastValidAuctionId": "1", | ||
"str:auctionById|u64:1": { | ||
"00-auctioned_token": "nested:str:NFT-123456|u64:1", | ||
"01-nr_auctioned_tokens": "biguint:1", | ||
"02-auction_type": "u8:1", | ||
"04-payment_token": "nested:str:EGLD|u64:0", | ||
"05-min_bid": "biguint:100", | ||
"06-max_bid": "u8:1|biguint:1000", | ||
"07-min_bid_diff": "biguint:0", | ||
"08-start_time": "u64:123,000", | ||
"09-deadline": "u64:123,456", | ||
"10-original_owner": "address:seller", | ||
"11-current_bid": "biguint:100", | ||
"12-current_winner": "address:first_bidder", | ||
"13-marketplace_cut_percentage": "biguint:1000", | ||
"14-creator_royalties_percentage": "biguint:2000" | ||
}, | ||
"str:lastValidOfferId": "1", | ||
"str:offerById|u64:1": { | ||
"01-offer_token": "nested:str:NFT-123456|u64:1|biguint:1", | ||
"01-payment": "nested:str:EGLD|u64:0|biguint:10", | ||
"04-start_time": "u64:123,000", | ||
"05-deadline": "u64:125,000", | ||
"06-offer_owner": "address:first_bidder" | ||
} | ||
}, | ||
"code": "file:../output/esdt-nft-marketplace.wasm" | ||
}, | ||
"+": {} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.