Struct dao::utils_contracts::DaoIdsContract
source · pub struct DaoIdsContract { /* private fields */ }
Expand description
Dao Ids contract manages voting ids in the system. Only a whitelisted account is eligible to generate ids.
For details see DaoIdsContract).
Implementations§
source§impl DaoIdsContract
impl DaoIdsContract
sourcepub fn init(&mut self)
pub fn init(&mut self)
Initializes a contract. Sets the deployer as the owner.
see AccessControl
sourcepub fn next_voting_id(&mut self) -> u32
pub fn next_voting_id(&mut self) -> u32
Returns the next voting id in the system.
§Errors
Throws NotWhitelisted
if the caller is not whitelisted.
sourcepub fn propose_new_owner(&mut self, owner: Address)
pub fn propose_new_owner(&mut self, owner: Address)
Changes the ownership of the contract. Transfers the ownership to the owner
.
Only the current owner is permitted to call this method.
Read more
sourcepub fn accept_new_owner(&mut self)
pub fn accept_new_owner(&mut self)
Accepts the new owner proposition. This can be called only by the proposed owner.
Read more
sourcepub fn add_to_whitelist(&mut self, address: Address)
pub fn add_to_whitelist(&mut self, address: Address)
Adds a new address to the whitelist.
sourcepub fn remove_from_whitelist(&mut self, address: Address)
pub fn remove_from_whitelist(&mut self, address: Address)
Remove address from the whitelist.
sourcepub fn is_whitelisted(&self, address: Address) -> bool
pub fn is_whitelisted(&self, address: Address) -> bool
Checks whether the given address is added to the whitelist.
Trait Implementations§
source§impl Clone for DaoIdsContract
impl Clone for DaoIdsContract
source§fn clone(&self) -> DaoIdsContract
fn clone(&self) -> DaoIdsContract
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Node for DaoIdsContract
impl Node for DaoIdsContract
source§impl OdraItem for DaoIdsContract
impl OdraItem for DaoIdsContract
Auto Trait Implementations§
impl RefUnwindSafe for DaoIdsContract
impl Send for DaoIdsContract
impl Sync for DaoIdsContract
impl Unpin for DaoIdsContract
impl UnwindSafe for DaoIdsContract
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
Mutably borrows from an owned value. Read more