Beispiel #1
0
        /// <summary>
        /// SmartContract Instance
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public override bool Instantiate(string[] args)
        {
            //Assettableownerkwy = contract admin key
            var contractAdmin = new[]
            {
                GetContractAddress(),
            };

            var insuranceTableName = GetInsuranceTableName();
            //AssetDiscripter(tablename,tracked ,proof,contractadmin(tableowner))
            var assettableDescriptor = new AssetTableDescriptor(insuranceTableName, false, false, contractAdmin);

            var participantListTableName = GetParticipantListTableName();
            //BinarytableDescriptor(tablename,tracks)
            var binarytableDescriptor = new BinaryTableDescriptor(participantListTableName, false);

            try
            {
                //statewrite is environment hold
                StateWriter.AddTable(assettableDescriptor);
                StateWriter.AddTable(binarytableDescriptor);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// SmartContract Instance
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public override bool Instantiate(string[] args)
        {
            //Assettableownerkwy = contract admin key
            var contractAdmin = new[]
            {
                GetContractAddress(),
            };

            var heritageAssetTableName = GetHeritageAssetTableName();
            //AssetDiscripter(tablename,tracked ,proof,contractadmin(tableowner))
            var assettableDescriptor = new AssetTableDescriptor(heritageAssetTableName, false, false, contractAdmin);

            var tangibleAssetNFTTableName = GetTangibleAssetNFTTableName();
            //NFTDiscripter(tablename,tracked ,proof,contractadmin(tableowner))
            var NFTtangibleassetDescripter = new NFTTableDescriptor(tangibleAssetNFTTableName, false, false, contractAdmin);

            var testamentNFTTableName = GetTestamentNFTTableName();
            //NFTDiscripter(tablename,tracked ,proof,contractadmin(tableowner))
            var NFTTestamentDiscripter = new NFTTableDescriptor(testamentNFTTableName, false, false, contractAdmin);

            var inheritanceManagementTableName = GetInheritanceManagementTableName();
            //BinarytableDescriptor(tablename,tracks)
            var binarytableDescriptor = new BinaryTableDescriptor(inheritanceManagementTableName, false);

            try
            {
                //statewrite is environment hold
                StateWriter.AddTable(assettableDescriptor);
                StateWriter.AddTable(NFTtangibleassetDescripter);
                StateWriter.AddTable(NFTTestamentDiscripter);
                StateWriter.AddTable(binarytableDescriptor);
                return(true);
            }
            catch
            {
                return(false);
            }
        }