Skip to content

Commit

Permalink
proxy-pause sc use a proper sc for extension (#1138)
Browse files Browse the repository at this point in the history
* proxy- pause sc use a proper sc for extension

* update cargo toml version

* fix contract builder to proxy-pause test

* update all contracts
  • Loading branch information
alyn509 committed Jun 27, 2023
1 parent e3baa63 commit 8669096
Show file tree
Hide file tree
Showing 40 changed files with 406 additions and 63 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ members = [
"contracts/examples/crypto-bubbles/meta",
"contracts/examples/crypto-zombies",
"contracts/examples/crypto-zombies/meta",
"contracts/examples/check-pause",
"contracts/examples/check-pause/meta",
"contracts/examples/crypto-kitties/kitty-ownership",
"contracts/examples/crypto-kitties/kitty-ownership/meta",
"contracts/examples/crypto-kitties/kitty-genetic-alg",
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/adder/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions contracts/examples/bonding-curve-contract/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions contracts/examples/check-pause/.gitignore
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*/
25 changes: 25 additions & 0 deletions contracts/examples/check-pause/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "check-pause"
version = "0.0.0"
authors = ["Alin Cruceat <alin.cruceat@multiversx.com>"]
edition = "2021"
publish = false

[lib]
path = "src/check_pause.rs"

[dev-dependencies]
num-bigint = "0.4.2"

[dependencies.multiversx-sc]
version = "0.41.3"
path = "../../../framework/base"

[dependencies.multiversx-sc-modules]
version = "0.41.3"
path = "../../../contracts/modules"

[dev-dependencies.multiversx-sc-scenario]
version = "0.41.3"
path = "../../../framework/scenario"

13 changes: 13 additions & 0 deletions contracts/examples/check-pause/meta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "check-pause-meta"
version = "0.0.0"
edition = "2021"
publish = false
authors = ["Alin Cruceat <alin.cruceat@multiversx.com>"]

[dependencies.check-pause]
path = ".."

[dependencies.multiversx-sc-meta]
version = "0.41.3"
path = "../../../../framework/meta"
3 changes: 3 additions & 0 deletions contracts/examples/check-pause/meta/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
multiversx_sc_meta::cli_main::<check_pause::AbiProvider>();
}
3 changes: 3 additions & 0 deletions contracts/examples/check-pause/multiversx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"language": "rust"
}
16 changes: 16 additions & 0 deletions contracts/examples/check-pause/src/check_pause.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![no_std]

multiversx_sc::imports!();

use multiversx_sc_modules::pause;

#[multiversx_sc::contract]
pub trait CheckPauseContract: pause::PauseModule {
#[init]
fn init(&self) {}

#[endpoint(checkPause)]
fn check_pause(&self) -> SCResult<bool> {
Ok(self.is_paused())
}
}
217 changes: 217 additions & 0 deletions contracts/examples/check-pause/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions contracts/examples/check-pause/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "check-pause-wasm"
version = "0.0.0"
edition = "2021"
authors = ["Alin Cruceat <alin.cruceat@multiversx.com>"]
publish = false

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

[workspace]
members = [".",]

[dev-dependencies]

[profile.release]
codegen-units = 1
opt-level = "z"
lto = true
debug = false
panic = "abort"

[dependencies.check-pause]
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "0.41.3"
path = "../../../../framework/wasm-adapter"
28 changes: 28 additions & 0 deletions contracts/examples/check-pause/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT.

////////////////////////////////////////////////////
////////////////// AUTO-GENERATED //////////////////
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 4
// Async Callback (empty): 1
// Total number of exported functions: 6

#![no_std]
#![feature(lang_items)]

multiversx_sc_wasm_adapter::allocator!();
multiversx_sc_wasm_adapter::panic_handler!();

multiversx_sc_wasm_adapter::endpoints! {
check_pause
(
checkPause
pause
unpause
isPaused
)
}

multiversx_sc_wasm_adapter::empty_callback! {}
4 changes: 2 additions & 2 deletions contracts/examples/crowdfunding-esdt/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8669096

Please sign in to comment.