Facing an issue while trying to query for a value in my contract. The value keeps getting retuned as null with an error. However, it works fine on substrate Contracts UI
Front end Dapp :
const gasLimit = 3000n * 1000000n;
// a limit to how much Balance to be used to pay for the storage created by the contract call
// if null is passed, unlimited balance can be used
const storageDepositLimit = null
// Load the contract instance
const Contract = new ContractPromise(api, abi, AlephsendContractAddress);
// Perform a read of the contract's `get` message
const callValue = await Contract.query.isPause("5HGn5UF5qdz8ShagwxRFSm387Hhd4wccAuVHZ17KtyyeUone",{
gasLimit,
storageDepositLimit,
});
console.log(callValue.output.toHuman());
Contract function :
#[ink(message)]
pub fn is_pause(&self) -> bool {
return self.paused;
}
This is how my storage is defined :
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#[ink::contract]
mod aleph_send {
use openbrush::contracts::traits::psp22::{PSP22Ref,PSP22Error};
use openbrush::contracts::ownable::*;
use scale::alloc::vec::Vec;
use openbrush::traits::Storage;
#[ink(storage)]
#[derive(Default, Storage)]
pub struct Aleph {
#[storage_field]
ownable: ownable::Data,
pub fee : Balance,
pub paused : bool
}
impl Aleph {...contract code}
Any help would be much appreciated!