pub struct HoprBoostInstance<P, N = Ethereum> { /* private fields */ }
Expand description
A HoprBoost
instance.
Contains type-safe methods for interacting with an on-chain instance of the
HoprBoost
contract located at a given address
, using a given
provider P
.
If the contract bytecode is available (see the sol!
documentation on how to provide it), the deploy
and deploy_builder
methods can
be used to deploy a new instance of the contract.
See the module-level documentation for all the available methods.
Implementations§
Source§impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Instantiation and getters/setters.
impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Instantiation and getters/setters.
Sourcepub const fn new(address: Address, provider: P) -> Self
pub const fn new(address: Address, provider: P) -> Self
Creates a new wrapper around an on-chain HoprBoost
contract instance.
See the wrapper’s documentation for more details.
Sourcepub async fn deploy(
provider: P,
newAdmin: Address,
baseTokenURI: String,
) -> Result<HoprBoostInstance<P, N>>
pub async fn deploy( provider: P, newAdmin: Address, baseTokenURI: String, ) -> Result<HoprBoostInstance<P, N>>
Deploys this contract using the given provider
and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use deploy_builder
instead.
Sourcepub fn deploy_builder(
provider: P,
newAdmin: Address,
baseTokenURI: String,
) -> RawCallBuilder<P, N>
pub fn deploy_builder( provider: P, newAdmin: Address, baseTokenURI: String, ) -> RawCallBuilder<P, N>
Creates a RawCallBuilder
for deploying this contract using the given provider
and constructor arguments, if any.
This is a simple wrapper around creating a RawCallBuilder
with the data set to
the bytecode concatenated with the constructor’s ABI-encoded arguments.
Sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
Source§impl<P: Clone, N> HoprBoostInstance<&P, N>
impl<P: Clone, N> HoprBoostInstance<&P, N>
Sourcepub fn with_cloned_provider(self) -> HoprBoostInstance<P, N>
pub fn with_cloned_provider(self) -> HoprBoostInstance<P, N>
Clones the provider and returns a new instance with the cloned provider.
Source§impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Function calls.
impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Function calls.
Sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
Creates a new call builder using this contract instance’s provider and address.
Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.
Sourcepub fn DEFAULT_ADMIN_ROLE(
&self,
) -> SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N>
pub fn DEFAULT_ADMIN_ROLE( &self, ) -> SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N>
Creates a new call builder for the [DEFAULT_ADMIN_ROLE
] function.
Sourcepub fn MINTER_ROLE(&self) -> SolCallBuilder<&P, MINTER_ROLECall, N>
pub fn MINTER_ROLE(&self) -> SolCallBuilder<&P, MINTER_ROLECall, N>
Creates a new call builder for the [MINTER_ROLE
] function.
Sourcepub fn approve(
&self,
to: Address,
tokenId: U256,
) -> SolCallBuilder<&P, approveCall, N>
pub fn approve( &self, to: Address, tokenId: U256, ) -> SolCallBuilder<&P, approveCall, N>
Creates a new call builder for the [approve
] function.
Sourcepub fn balanceOf(&self, owner: Address) -> SolCallBuilder<&P, balanceOfCall, N>
pub fn balanceOf(&self, owner: Address) -> SolCallBuilder<&P, balanceOfCall, N>
Creates a new call builder for the [balanceOf
] function.
Sourcepub fn batchMint(
&self,
to: Vec<Address>,
boostType: String,
boostRank: String,
boostNumerator: U256,
redeemDeadline: U256,
) -> SolCallBuilder<&P, batchMintCall, N>
pub fn batchMint( &self, to: Vec<Address>, boostType: String, boostRank: String, boostNumerator: U256, redeemDeadline: U256, ) -> SolCallBuilder<&P, batchMintCall, N>
Creates a new call builder for the [batchMint
] function.
Sourcepub fn boostOf(&self, tokenId: U256) -> SolCallBuilder<&P, boostOfCall, N>
pub fn boostOf(&self, tokenId: U256) -> SolCallBuilder<&P, boostOfCall, N>
Creates a new call builder for the [boostOf
] function.
Sourcepub fn getApproved(
&self,
tokenId: U256,
) -> SolCallBuilder<&P, getApprovedCall, N>
pub fn getApproved( &self, tokenId: U256, ) -> SolCallBuilder<&P, getApprovedCall, N>
Creates a new call builder for the [getApproved
] function.
Sourcepub fn getRoleAdmin(
&self,
role: FixedBytes<32>,
) -> SolCallBuilder<&P, getRoleAdminCall, N>
pub fn getRoleAdmin( &self, role: FixedBytes<32>, ) -> SolCallBuilder<&P, getRoleAdminCall, N>
Creates a new call builder for the [getRoleAdmin
] function.
Sourcepub fn getRoleMember(
&self,
role: FixedBytes<32>,
index: U256,
) -> SolCallBuilder<&P, getRoleMemberCall, N>
pub fn getRoleMember( &self, role: FixedBytes<32>, index: U256, ) -> SolCallBuilder<&P, getRoleMemberCall, N>
Creates a new call builder for the [getRoleMember
] function.
Sourcepub fn getRoleMemberCount(
&self,
role: FixedBytes<32>,
) -> SolCallBuilder<&P, getRoleMemberCountCall, N>
pub fn getRoleMemberCount( &self, role: FixedBytes<32>, ) -> SolCallBuilder<&P, getRoleMemberCountCall, N>
Creates a new call builder for the [getRoleMemberCount
] function.
Sourcepub fn grantRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, grantRoleCall, N>
pub fn grantRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, grantRoleCall, N>
Creates a new call builder for the [grantRole
] function.
Sourcepub fn hasRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, hasRoleCall, N>
pub fn hasRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, hasRoleCall, N>
Creates a new call builder for the [hasRole
] function.
Sourcepub fn isApprovedForAll(
&self,
owner: Address,
operator: Address,
) -> SolCallBuilder<&P, isApprovedForAllCall, N>
pub fn isApprovedForAll( &self, owner: Address, operator: Address, ) -> SolCallBuilder<&P, isApprovedForAllCall, N>
Creates a new call builder for the [isApprovedForAll
] function.
Sourcepub fn mint(
&self,
to: Address,
boostType: String,
boostRank: String,
boostNumerator: U256,
redeemDeadline: U256,
) -> SolCallBuilder<&P, mintCall, N>
pub fn mint( &self, to: Address, boostType: String, boostRank: String, boostNumerator: U256, redeemDeadline: U256, ) -> SolCallBuilder<&P, mintCall, N>
Creates a new call builder for the [mint
] function.
Sourcepub fn name(&self) -> SolCallBuilder<&P, nameCall, N>
pub fn name(&self) -> SolCallBuilder<&P, nameCall, N>
Creates a new call builder for the [name
] function.
Sourcepub fn ownerOf(&self, tokenId: U256) -> SolCallBuilder<&P, ownerOfCall, N>
pub fn ownerOf(&self, tokenId: U256) -> SolCallBuilder<&P, ownerOfCall, N>
Creates a new call builder for the [ownerOf
] function.
Sourcepub fn reclaimErc20Tokens(
&self,
tokenAddress: Address,
) -> SolCallBuilder<&P, reclaimErc20TokensCall, N>
pub fn reclaimErc20Tokens( &self, tokenAddress: Address, ) -> SolCallBuilder<&P, reclaimErc20TokensCall, N>
Creates a new call builder for the [reclaimErc20Tokens
] function.
Sourcepub fn reclaimErc721Tokens(
&self,
tokenAddress: Address,
tokenId: U256,
) -> SolCallBuilder<&P, reclaimErc721TokensCall, N>
pub fn reclaimErc721Tokens( &self, tokenAddress: Address, tokenId: U256, ) -> SolCallBuilder<&P, reclaimErc721TokensCall, N>
Creates a new call builder for the [reclaimErc721Tokens
] function.
Sourcepub fn renounceRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, renounceRoleCall, N>
pub fn renounceRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, renounceRoleCall, N>
Creates a new call builder for the [renounceRole
] function.
Sourcepub fn revokeRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, revokeRoleCall, N>
pub fn revokeRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, revokeRoleCall, N>
Creates a new call builder for the [revokeRole
] function.
Sourcepub fn safeTransferFrom_0(
&self,
from: Address,
to: Address,
tokenId: U256,
) -> SolCallBuilder<&P, safeTransferFrom_0Call, N>
pub fn safeTransferFrom_0( &self, from: Address, to: Address, tokenId: U256, ) -> SolCallBuilder<&P, safeTransferFrom_0Call, N>
Creates a new call builder for the [safeTransferFrom_0
] function.
Sourcepub fn safeTransferFrom_1(
&self,
from: Address,
to: Address,
tokenId: U256,
_data: Bytes,
) -> SolCallBuilder<&P, safeTransferFrom_1Call, N>
pub fn safeTransferFrom_1( &self, from: Address, to: Address, tokenId: U256, _data: Bytes, ) -> SolCallBuilder<&P, safeTransferFrom_1Call, N>
Creates a new call builder for the [safeTransferFrom_1
] function.
Sourcepub fn setApprovalForAll(
&self,
operator: Address,
approved: bool,
) -> SolCallBuilder<&P, setApprovalForAllCall, N>
pub fn setApprovalForAll( &self, operator: Address, approved: bool, ) -> SolCallBuilder<&P, setApprovalForAllCall, N>
Creates a new call builder for the [setApprovalForAll
] function.
Sourcepub fn supportsInterface(
&self,
interfaceId: FixedBytes<4>,
) -> SolCallBuilder<&P, supportsInterfaceCall, N>
pub fn supportsInterface( &self, interfaceId: FixedBytes<4>, ) -> SolCallBuilder<&P, supportsInterfaceCall, N>
Creates a new call builder for the [supportsInterface
] function.
Sourcepub fn symbol(&self) -> SolCallBuilder<&P, symbolCall, N>
pub fn symbol(&self) -> SolCallBuilder<&P, symbolCall, N>
Creates a new call builder for the [symbol
] function.
Sourcepub fn tokenByIndex(
&self,
index: U256,
) -> SolCallBuilder<&P, tokenByIndexCall, N>
pub fn tokenByIndex( &self, index: U256, ) -> SolCallBuilder<&P, tokenByIndexCall, N>
Creates a new call builder for the [tokenByIndex
] function.
Sourcepub fn tokenOfOwnerByIndex(
&self,
owner: Address,
index: U256,
) -> SolCallBuilder<&P, tokenOfOwnerByIndexCall, N>
pub fn tokenOfOwnerByIndex( &self, owner: Address, index: U256, ) -> SolCallBuilder<&P, tokenOfOwnerByIndexCall, N>
Creates a new call builder for the [tokenOfOwnerByIndex
] function.
Sourcepub fn tokenURI(&self, tokenId: U256) -> SolCallBuilder<&P, tokenURICall, N>
pub fn tokenURI(&self, tokenId: U256) -> SolCallBuilder<&P, tokenURICall, N>
Creates a new call builder for the [tokenURI
] function.
Sourcepub fn totalSupply(&self) -> SolCallBuilder<&P, totalSupplyCall, N>
pub fn totalSupply(&self) -> SolCallBuilder<&P, totalSupplyCall, N>
Creates a new call builder for the [totalSupply
] function.
Sourcepub fn transferFrom(
&self,
from: Address,
to: Address,
tokenId: U256,
) -> SolCallBuilder<&P, transferFromCall, N>
pub fn transferFrom( &self, from: Address, to: Address, tokenId: U256, ) -> SolCallBuilder<&P, transferFromCall, N>
Creates a new call builder for the [transferFrom
] function.
Sourcepub fn typeAt(&self, typeIndex: U256) -> SolCallBuilder<&P, typeAtCall, N>
pub fn typeAt(&self, typeIndex: U256) -> SolCallBuilder<&P, typeAtCall, N>
Creates a new call builder for the [typeAt
] function.
Sourcepub fn typeIndexOf(
&self,
tokenId: U256,
) -> SolCallBuilder<&P, typeIndexOfCall, N>
pub fn typeIndexOf( &self, tokenId: U256, ) -> SolCallBuilder<&P, typeIndexOfCall, N>
Creates a new call builder for the [typeIndexOf
] function.
Sourcepub fn typeOf(&self, tokenId: U256) -> SolCallBuilder<&P, typeOfCall, N>
pub fn typeOf(&self, tokenId: U256) -> SolCallBuilder<&P, typeOfCall, N>
Creates a new call builder for the [typeOf
] function.
Sourcepub fn updateBaseURI(
&self,
baseTokenURI: String,
) -> SolCallBuilder<&P, updateBaseURICall, N>
pub fn updateBaseURI( &self, baseTokenURI: String, ) -> SolCallBuilder<&P, updateBaseURICall, N>
Creates a new call builder for the [updateBaseURI
] function.
Source§impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Event filters.
impl<P: Provider<N>, N: Network> HoprBoostInstance<P, N>
Event filters.
Sourcepub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
Creates a new event filter using this contract instance’s provider and address.
Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.
Sourcepub fn Approval_filter(&self) -> Event<&P, Approval, N>
pub fn Approval_filter(&self) -> Event<&P, Approval, N>
Creates a new event filter for the Approval
event.
Sourcepub fn ApprovalForAll_filter(&self) -> Event<&P, ApprovalForAll, N>
pub fn ApprovalForAll_filter(&self) -> Event<&P, ApprovalForAll, N>
Creates a new event filter for the ApprovalForAll
event.
Sourcepub fn BoostMinted_filter(&self) -> Event<&P, BoostMinted, N>
pub fn BoostMinted_filter(&self) -> Event<&P, BoostMinted, N>
Creates a new event filter for the BoostMinted
event.
Sourcepub fn RoleAdminChanged_filter(&self) -> Event<&P, RoleAdminChanged, N>
pub fn RoleAdminChanged_filter(&self) -> Event<&P, RoleAdminChanged, N>
Creates a new event filter for the RoleAdminChanged
event.
Sourcepub fn RoleGranted_filter(&self) -> Event<&P, RoleGranted, N>
pub fn RoleGranted_filter(&self) -> Event<&P, RoleGranted, N>
Creates a new event filter for the RoleGranted
event.
Sourcepub fn RoleRevoked_filter(&self) -> Event<&P, RoleRevoked, N>
pub fn RoleRevoked_filter(&self) -> Event<&P, RoleRevoked, N>
Creates a new event filter for the RoleRevoked
event.
Sourcepub fn Transfer_filter(&self) -> Event<&P, Transfer, N>
pub fn Transfer_filter(&self) -> Event<&P, Transfer, N>
Creates a new event filter for the Transfer
event.
Trait Implementations§
Source§impl<P: Clone, N: Clone> Clone for HoprBoostInstance<P, N>
impl<P: Clone, N: Clone> Clone for HoprBoostInstance<P, N>
Source§fn clone(&self) -> HoprBoostInstance<P, N>
fn clone(&self) -> HoprBoostInstance<P, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<P, N> Freeze for HoprBoostInstance<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for HoprBoostInstance<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for HoprBoostInstance<P, N>
impl<P, N> Sync for HoprBoostInstance<P, N>
impl<P, N> Unpin for HoprBoostInstance<P, N>
impl<P, N> UnwindSafe for HoprBoostInstance<P, N>where
P: UnwindSafe,
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more