Skip to content

Commit 85e1b82

Browse files
authored
A0-1238: Marketplace for auctioning tickets (#613)
* Prototype dummy marketplace * Implement selling tickets * Emit events from marketplace * Add docs * Deploy markets for all games * Improve cosmetics * Wrap original errors where possible * Add max_price to buy()
1 parent 3a47b89 commit 85e1b82

File tree

8 files changed

+1485
-18
lines changed

8 files changed

+1485
-18
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# IDEs
2-
/.idea
2+
**/.idea
33
/.vscode
44
.projectile
55

@@ -14,7 +14,7 @@
1414
*.out
1515

1616
# docker
17-
docker/data/
17+
**/docker/data/
1818
db/
1919
keystore/
2020
chainspec.json

contracts/button/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod button_game {
1010
use game_token::MINT_TO_SELECTOR;
1111
use ink_env::{
1212
call::{build_call, Call, ExecutionInput, Selector},
13-
DefaultEnvironment, Error as InkEnvError,
13+
CallFlags, DefaultEnvironment, Error as InkEnvError,
1414
};
1515
use ink_lang::{codegen::EmitEvent, reflect::ContractEventBase};
1616
use ink_prelude::{format, vec};
@@ -341,6 +341,7 @@ mod button_game {
341341
.push_arg(value)
342342
.push_arg(vec![0x0]),
343343
)
344+
.call_flags(CallFlags::default().set_allow_reentry(true))
344345
.returns::<Result<(), PSP22Error>>()
345346
.fire()
346347
}

contracts/game_token/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#![cfg_attr(not(feature = "std"), no_std)]
22
#![feature(min_specialization)]
33

4-
pub use crate::game_token::{BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_SELECTOR};
4+
pub use crate::game_token::{
5+
BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR,
6+
};
57

68
#[openbrush::contract]
79
pub mod game_token {
@@ -20,6 +22,7 @@ pub mod game_token {
2022

2123
pub const BALANCE_OF_SELECTOR: [u8; 4] = [0x65, 0x68, 0x38, 0x2f];
2224
pub const TRANSFER_SELECTOR: [u8; 4] = [0xdb, 0x20, 0xf9, 0xf5];
25+
pub const TRANSFER_FROM_SELECTOR: [u8; 4] = [0x54, 0xb3, 0xc7, 0x6e];
2326
// TODO : use correct selector when mint/burn is implemented
2427
pub const MINT_TO_SELECTOR: [u8; 4] = [0x0, 0x0, 0x0, 0x0];
2528

0 commit comments

Comments
 (0)