Example #1
0
        //Retrieve state variables through contract
        public HashSet <VariableDeclaration> retrieveStateVariables(ContractDefinition contract)
        {
            bool containsKey = StateVarMaps.ContainsKey(contract);

            if (containsKey)
            {
                return(StateVarMaps[contract]);
            }
            else
            {
                new HashSet <VariableDeclaration>();
            }
            return(null);
        }
Example #2
0
        public void AddStateVarToContract(ContractDefinition contract, VariableDeclaration Declaration)
        {
            //check whether collection does not already contain the new addition
            //if not then create a new hashset with the proposed contract and place it into the collection
            if (StateVarMaps.ContainsKey(contract) == false)
            {
                StateVarMaps[contract] = new HashSet <VariableDeclaration>();
            }

            //add the node to the indexed contract within the collection
            StateVarMaps[contract].Add(Declaration);
            //assign statevar collections map with the index of varDec1 the value of the given contract
            StateVarToContractMap[Declaration] = contract;
        }