Questions tagged [openbrush]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
4 answers
49 views

ink-e2e: Metadata artifacts not generated when importing crate

Context: I am trying to detach end-to-end tests from my main contract lib.rs. I created a new module in tests_e2e.rs. I import the module in main contract like so: lib.rs...vvv #[cfg(all(test, feature ...
0 votes
1 answer
40 views

Difference between {Contract}Ref and Hash?

while contract instantiation inside constructor new function parameter, we can find {Contract}Ref and Hash. If new function accepts {Contract}Ref as parameter, then type is AccountId and if new ...
  • 566
0 votes
2 answers
135 views

Traits with "#[openbrush::trait_definition]" cannot be referenced

I want to implement a base contract that multiple contracts should implement. I decided to use "#[openbrush::trait_definition]" because "[#ink(message)]" cannot be added in the ...
1 vote
1 answer
36 views

What is new way to implement custom data structs (in ink! 4)?

I am trying to upgrade then compile a token contract (employing openbrush) from ink!3 to ink!4. My understanding is that SpreadAllocate, StorageLayout, etc. have been removed from the ink!4 release. ...
0 votes
2 answers
51 views

PSP22 cross-contract call to get metadata such as token decimals and token name using ink!

I have a little problem here. I have the address of a contract (PSP22 token) with the {}Ref associated with it. I want to make a cross-contract call to get the decimals of the contract. Its Ref is use ...
3 votes
1 answer
58 views

Best practices for handling my own errors and openbrush's errors?

I am using ink! to implement the contract. I have implemented my own error, and the contract function has this own error as a return value. For example, suppose that function implements openbrush's ...
1 vote
1 answer
57 views

What is the 'wasm' argument in CodePromise?

I'm building an application that allows anyone to deploy PSP34 using Openbrush contract. I want to allow users to deploy a new contract from the UI and upload an image to mint the NFT. I have ...
  • 73
0 votes
1 answer
54 views

PSP34Mintable::mint() as payable function

I'm using PSP34 from openbrush in ink! contract and want to override mint() function that comes with PSP34Mintable trait. Since this contract should accept payments for the mint() call, a payable is ...
  • 420
1 vote
1 answer
214 views

How to implement cross contract calls correctly?

I've been trying for a few days now to implement cross contract calls but somehow I can't seem to make it right. So here is my code and I hope one of you can point out my mistake to me. I want to call ...
  • 393