1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OpenBrushでSmartContract開発

Last updated at Posted at 2022-05-31

OpenBrushとは

ink!のための、スマートコントラクト開発ライブラリ群です。
EthereumのOpenZipppelinのように、コードの再利用をテーマとしています。

(カンファレンス)
https://hopin.com/events/wasm-conference-2022

(動画)
https://www.youtube.com/watch?v=I5OFGNVvzOc

(本家)
https://openbrush.io/

versions

1.8.0 3days ago
https://crates.io/crates/brush_contracts_derive/versions

どのような機能があるか?

https://github.com/Supercolony-net/openbrush-contracts
https://lib.rs/crates/brush_contracts_derive

PSP22 - Fungible Token (ERC20 equivalent) with extensions
PSP34 - Non-Fungible Token (ERC721 equivalent) with extensions
Multi-Token ERC1155 equivalent with extensions
Ownable Restrict access to action for non-owners
Access Control Define set of roles and restrict access to action by roles
Reentrancy guard Prevent reentrant calls to a function
Pausable Pause/Unpause the contract to disable/enable some operations
Timelock Controller Execute transactions with some delay
Payment Splitter Split amount of native tokens between participants

WASMのPSPとは?

PSP-Polkadot標準Polkadot Standards Proposals(PSP)と呼ばれます。
ERCライクなものと考えればよさそうです。

ためしにpayment splitterを使って実装してみる

#[brush::contract]

use brush::contracts::payment_splitter::*;

$ cargo contract new own_paymenet_splitter_demo
$ cargo +nightly contract buil


ERROR: Mismatching versions of `parity-scale-codec` were found!
Please ensure that your contract and your ink! dependencies use a compatible version of this package.

// parity-scale-codecのversion => 3 に変更
// scale-infoのversion => 2 に変更
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }


1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?