Skip to content

Commit

Permalink
A0-1238: Marketplace for auctioning tickets (#613)
Browse files Browse the repository at this point in the history
* 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()
  • Loading branch information
obrok authored Sep 14, 2022
1 parent 3a47b89 commit 85e1b82
Show file tree
Hide file tree
Showing 8 changed files with 1,485 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IDEs
/.idea
**/.idea
/.vscode
.projectile

Expand All @@ -14,7 +14,7 @@
*.out

# docker
docker/data/
**/docker/data/
db/
keystore/
chainspec.json
Expand Down
3 changes: 2 additions & 1 deletion contracts/button/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod button_game {
use game_token::MINT_TO_SELECTOR;
use ink_env::{
call::{build_call, Call, ExecutionInput, Selector},
DefaultEnvironment, Error as InkEnvError,
CallFlags, DefaultEnvironment, Error as InkEnvError,
};
use ink_lang::{codegen::EmitEvent, reflect::ContractEventBase};
use ink_prelude::{format, vec};
Expand Down Expand Up @@ -341,6 +341,7 @@ mod button_game {
.push_arg(value)
.push_arg(vec![0x0]),
)
.call_flags(CallFlags::default().set_allow_reentry(true))
.returns::<Result<(), PSP22Error>>()
.fire()
}
Expand Down
5 changes: 4 additions & 1 deletion contracts/game_token/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![feature(min_specialization)]

pub use crate::game_token::{BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_SELECTOR};
pub use crate::game_token::{
BALANCE_OF_SELECTOR, MINT_TO_SELECTOR, TRANSFER_FROM_SELECTOR, TRANSFER_SELECTOR,
};

#[openbrush::contract]
pub mod game_token {
Expand All @@ -20,6 +22,7 @@ pub mod game_token {

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

Expand Down
Loading

0 comments on commit 85e1b82

Please sign in to comment.