コード例 #1
0
 private static FunctionABI GetNethFunctionAbi(AbiFunctionDefinition definition)
 {
     return(new FunctionABI(definition.Name, definition.Constant)
     {
         InputParameters = GetNethParameters(definition.Inputs),
         OutputParameters = GetNethParameters(definition.Outputs)
     });
 }
コード例 #2
0
        public static AbiFunctionDefinition Builder(JToken abiJson)
        {
            var definition = new AbiFunctionDefinition
            {
                Name     = abiJson["name"].ToString(),
                Constant = (bool)abiJson["constant"],
                Payable  = (bool)abiJson["payable"]
            };

            Enum.TryParse(abiJson["stateMutability"].ToString(), true,
                          out AbiStateMutability stateMutability);
            definition.StateMutability = stateMutability;

            definition.Inputs        = AbiParameterBuilder.Builder(abiJson["inputs"].ToString());
            definition.Outputs       = AbiParameterBuilder.Builder(abiJson["outputs"].ToString());
            definition.Sha3Signature = GetNethFunctionAbi(definition).Sha3Signature.ToBytes();

            return(definition);
        }
コード例 #3
0
 public AbiFunctionCoder(AbiFunctionDefinition definition)
 {
     _definition = definition;
 }
コード例 #4
0
 public AbiFunctionCoder(string abiJson)
 {
     _definition = AbiFunctionDefinition.Builder(abiJson);
 }