Пример #1
0
        public SolidityFunction(string functionName, SolidityVisibility visibility, string returns = "", bool isView = false)
        {
            this.functionName = LiquidString.Create(functionName);
            this.visibility   = LiquidString.Create(visibility.ToString().ToLower());
            this.returns      = LiquidString.Create(returns);
            this.isView       = isView;


            modifiers = new List <string>();

            // Has to be payable and has to be public (for now, solidity v0.6.x)
            // TODO: Payable from DAS contract field instead of function name
            if (functionName.ToLower().EndsWith("payable"))
            {
                modifiers.Add("payable");
                if (visibility == SolidityVisibility.Internal)
                {
                    this.visibility = LiquidString.Create("public");
                }
            }
        }