generated from multiversx/mx-template-sc
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into proxy-actions
- Loading branch information
Showing
18 changed files
with
1,510 additions
and
0 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,7 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
*/target/ | ||
|
||
# The mxpy output | ||
/output*/ |
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,15 @@ | ||
[package] | ||
name = "nft-escrow" | ||
version = "0.0.0" | ||
authors = [ "you",] | ||
edition = "2018" | ||
publish = false | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[dependencies.multiversx-sc] | ||
version = "0.43.4" | ||
|
||
[dev-dependencies.multiversx-sc-scenario] | ||
version = "0.43.4" |
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,14 @@ | ||
[package] | ||
name = "nft-escrow-meta" | ||
version = "0.0.0" | ||
edition = "2018" | ||
publish = false | ||
authors = [ "you",] | ||
|
||
[dev-dependencies] | ||
|
||
[dependencies.nft-escrow] | ||
path = ".." | ||
|
||
[dependencies.multiversx-sc-meta] | ||
version = "0.43.4" |
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,3 @@ | ||
fn main() { | ||
multiversx_sc_meta::cli_main::<nft_escrow::AbiProvider>(); | ||
} |
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,3 @@ | ||
{ | ||
"language": "rust" | ||
} |
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,18 @@ | ||
name = "empty" | ||
contract_trait = "EmptyContract" | ||
src_file = "empty.rs" | ||
rename_pairs = [ | ||
[ | ||
"blockchain.set_current_dir_from_workspace(\"contracts/examples/empty\");", | ||
"// blockchain.set_current_dir_from_workspace(\"relative path to your workspace, if applicable\");", | ||
], | ||
] | ||
files_include = [ | ||
"meta", | ||
"scenarios", | ||
"src", | ||
"tests", | ||
"wasm/Cargo.toml", | ||
"Cargo.toml", | ||
"multiversx.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,254 @@ | ||
{ | ||
"name": "buy nft", | ||
"steps": [ | ||
{ | ||
"step": "externalSteps", | ||
"path": "escrow.scen.json" | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept-offer-not-exists", | ||
"tx": { | ||
"from": "address:second", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"2" | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "4", | ||
"message": "str:Offer does not exist", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept-offer-only-wanted", | ||
"tx": { | ||
"from": "address:first", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"1" | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "4", | ||
"message": "str:Can not accept this offer", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept-other-token", | ||
"tx": { | ||
"from": "address:second", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"1" | ||
], | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:SEMIFUNG-123456", | ||
"value": "1000", | ||
"nonce": "1" | ||
} | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "4", | ||
"message": "str:NFT does not match", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept-other-nonce", | ||
"tx": { | ||
"from": "address:second", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"1" | ||
], | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:NFT2-654321", | ||
"value": "1", | ||
"nonce": "1" | ||
} | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "4", | ||
"message": "str:NFT does not match", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept-other-amount", | ||
"tx": { | ||
"from": "address:second", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"1" | ||
], | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:NFT2-654321", | ||
"value": "2", | ||
"nonce": "2" | ||
} | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "4", | ||
"message": "str:NFT does not match", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "scCall", | ||
"id": "accept", | ||
"tx": { | ||
"from": "address:second", | ||
"to": "sc:nft-escrow", | ||
"egldValue": "0", | ||
"function": "accept", | ||
"arguments": [ | ||
"1" | ||
], | ||
"esdtValue": [ | ||
{ | ||
"tokenIdentifier": "str:NFT2-654321", | ||
"value": "1", | ||
"nonce": "2" | ||
} | ||
], | ||
"gasLimit": "10,000,000", | ||
"gasPrice": "0" | ||
}, | ||
"expect": { | ||
"out": [], | ||
"status": "0", | ||
"gas": "*", | ||
"refund": "*" | ||
} | ||
}, | ||
{ | ||
"step": "checkState", | ||
"accounts": { | ||
"address:first": { | ||
"nonce": "6", | ||
"balance": "0", | ||
"esdt": { | ||
"str:FUNG-123456": "1000", | ||
"str:SEMIFUNG-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1000" | ||
} | ||
] | ||
}, | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "2", | ||
"balance": "1" | ||
} | ||
] | ||
}, | ||
"str:NFT2-654321": { | ||
"instances": [ | ||
{ | ||
"nonce": "2", | ||
"balance": "1" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"address:second": { | ||
"nonce": "5", | ||
"balance": "0", | ||
"esdt": { | ||
"str:FUNG-123456": "1000", | ||
"str:SEMIFUNG-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1000" | ||
} | ||
] | ||
}, | ||
"str:NFT-123456": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1" | ||
} | ||
] | ||
}, | ||
"str:NFT2-654321": { | ||
"instances": [ | ||
{ | ||
"nonce": "1", | ||
"balance": "1" | ||
}, | ||
{ | ||
"nonce": "2", | ||
"balance": "1" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"sc:nft-escrow": { | ||
"nonce": "0", | ||
"balance": "0", | ||
"esdt": { | ||
"str:NFT-123456": { | ||
"instances": [] | ||
} | ||
}, | ||
"storage": { | ||
"str:lastOfferId": "1" | ||
}, | ||
"code": "file:../output/nft-escrow.wasm", | ||
"owner": "address:owner" | ||
}, | ||
"+": "" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.