Closed ilhanu closed 1 year ago
Notes:
nft_pallet
.roles_pallet
RepApprovalList
storageVec<T::accountId>
, and we should also think about adding a field metadata
to all roles
Below is a sample of representative role implementation the file types.rs
of pallet_roles
://----------------------------------------------------------------------------------------------------------------
//-------------REPRESENTATIVE STRUCT DECLARATION & IMPLEMENTATION_BEGIN----------------------
#[derive(Clone, Encode, Decode, Default, PartialEq, Eq, TypeInfo)]
#[scale_info(skip_type_params(T))]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct Representative<T: Config> {
pub account_id: T::AccountId,
pub age: BlockNumberOf<T>,
pub activated: bool,
pub assets_accounts: Vec<T::AccountId>,
}
impl<T: Config> Representative<T>
where
types::Representative<T>: EncodeLike<types::Representative<T>>,
{
//--------------------------------------------------------------------
//-------------REPRESENTATIVE CREATION METHOD_BEGIN----------------------
pub fn new(acc: OriginFor<T>) -> DispatchResult {
let caller = ensure_signed(acc)?;
let now = <frame_system::Pallet<T>>::block_number();
ensure!(!RepresentativeLog::<T>::contains_key(&caller), Error::<T>::NoneValue);
let rep = Representative { account_id: caller, age: now, activated: false, assets_accounts: Vec::new()};
RepApprovalList::<T>::mutate(|val| {
val.0.push(hw);
});
Ok(())
}
//-------------HOUSE SELLER CREATION METHOD_END----------------------
//------------------------------------------------------------------
}
//-------------REPRESENTATIVE STRUCT DECLARATION & IMPLEMENTATION_END----------------------
//--------------------------------------------------------------------------------------------------------------
Add new roles and permission, the actions these new roles can have are currently limited to the below list of actions.
The notary can finalize the sale and the asset will be
purchased
. Also the notary can reject the sale and the asset will be back to therejected
state and the owner can decide tosell
it or todelist
the asset.The cost for the notary will be paid from the bond the seller proposed.
Representative (can propose a tenant)
The
representative
can propose atenant
and the owners can vote on it. The cost for the representative will be paid from the virtual account, which is the account that holds the funds for the asset and is of the owners.Owners (can vote on governance)
The owners are the investors, what makes the distinction is that they own asset of the specific unique asset.
Currently the only flow we are implementing is the appointing of a representative. The owners can vote on it and the tally will be done by the democracy pallet. The cost for the owners will be paid from the virtual account, which is the account that holds the funds for the asset and is of the owners.