Beispiel #1
0
        /// <summary>
        /// If input.Period == 0, the result will be the address of general ledger of a certain profit item;
        /// Otherwise the result will be the address of a specific account period of a certain profit item,
        /// which profit receivers will gain profits from.
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public override Address GetSchemeAddress(SchemePeriod input)
        {
            var virtualAddress = Context.ConvertVirtualAddressToContractAddress(input.SchemeId);

            return(input.Period == 0
                ? virtualAddress
                : GetDistributedPeriodProfitsVirtualAddress(virtualAddress, input.Period));
        }
Beispiel #2
0
        public override DistributedProfitsInfo GetDistributedProfitsInfo(SchemePeriod input)
        {
            var virtualAddress = Context.ConvertVirtualAddressToContractAddress(input.SchemeId);
            var releasedProfitsVirtualAddress = GetDistributedPeriodProfitsVirtualAddress(virtualAddress, input.Period);

            return(State.DistributedProfitsMap[releasedProfitsVirtualAddress] ?? new DistributedProfitsInfo
            {
                TotalShares = -1
            });
        }