Skip to content

Commit

Permalink
examples: Permissioned markets (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
armaniferrante authored Jul 10, 2021
1 parent 46cccd8 commit 5018e98
Show file tree
Hide file tree
Showing 19 changed files with 1,350 additions and 67 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "examples/cfo/deps/stake"]
path = examples/cfo/deps/stake
url = https://github.com/project-serum/stake.git
[submodule "examples/permissioned-markets/deps/serum-dex"]
path = examples/permissioned-markets/deps/serum-dex
url = https://github.com/project-serum/serum-dex
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ incremented for features.

## [Unreleased]

### Features

* lang: Adds `require` macro for specifying assertions that return error codes on failure ([#483](https://github.com/project-serum/anchor/pull/483)).
* lang: Allow one to specify arbitrary programs as the owner when creating PDA ([#483](https://github.com/project-serum/anchor/pull/483)).
* lang: A new `bump` keyword is added to the accounts constraints, which is used to add an optional bump seed to the end of a `seeds` array. When used in conjunction with *both* `init` and `seeds`, then the program executes `find_program_address` to assert that the given bump is the canonical bump ([#483](https://github.com/project-serum/anchor/pull/483)).

### Fixes

* lang: Preserve all instruction data for fallback functions ([#483](https://github.com/project-serum/anchor/pull/483)).
* ts: Event listener not firing when creating associated accounts ([#356](https://github.com/project-serum/anchor/issues/356)).

## [0.11.0] - 2021-07-03
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ members = [
exclude = [
"examples/swap/deps/serum-dex",
"examples/cfo/deps/serum-dex",
"examples/permissioned-markets/deps/serum-dex",
]
13 changes: 13 additions & 0 deletions examples/permissioned-markets/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[provider]
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "anchor run build && anchor test"
build = "anchor run build-deps && anchor build"
build-deps = "anchor run build-dex"
build-dex = "pushd deps/serum-dex/dex/ && cargo build-bpf && popd"

[[test.genesis]]
address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
program = "./deps/serum-dex/dex/target/deploy/serum_dex.so"
8 changes: 8 additions & 0 deletions examples/permissioned-markets/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
members = [
"programs/*"
]

exclude = [
"deps/serum-dex",
]
1 change: 1 addition & 0 deletions examples/permissioned-markets/deps/serum-dex
Submodule serum-dex added at 1f6d58
13 changes: 13 additions & 0 deletions examples/permissioned-markets/migrations/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

// Migrations are an early feature. Currently, they're nothing more than this
// single deploy script that's invoked from the CLI, injecting a provider
// configured from the workspace's Anchor.toml.

const anchor = require("@project-serum/anchor");

module.exports = async function (provider) {
// Configure client to use the provider.
anchor.setProvider(provider);

// Add your deploy script here.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "permissioned-markets"
version = "0.1.0"
description = "Created with Anchor"
edition = "2018"

[lib]
crate-type = ["cdylib", "lib"]
name = "permissioned_markets"

[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = { path = "../../../../lang" }
anchor-spl = { path = "../../../../spl" }
serum_dex = { path = "../../deps/serum-dex/dex", features = ["no-entrypoint"] }
solana-program = "1.7.4"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
Loading

0 comments on commit 5018e98

Please sign in to comment.