public async Task <ACI> GenerateACIAsync(string contractCode, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { await CheckCompilerBackendAsync(); if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } Contract body = new Contract { Code = contractCode, Options = new CompileOpts { Backend = opts.Value } }; return(await _compilerClient.GenerateACIAsync(body, token)); }
public Task ValidateByteCodeAsync(string source, string bytecode, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { ValidateByteCodeInput input = new ValidateByteCodeInput(); if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } input.Options = new CompileOpts() { Backend = opts.Value }; input.Bytecode = bytecode; input.Source = source; return(_compilerClient.ValidateByteCodeAsync(input, token)); }
public static ByteCode Compile(this FlatClient client, string contractCode, string srcFile, object fileSystem, CompileOptsBackend?opts = null) => client.CompileAsync(contractCode, srcFile, fileSystem, opts).RunAndUnwrap();
public static ACI GenerateACI(this FlatClient client, string contractCode, CompileOptsBackend?opts = null) => client.GenerateACIAsync(contractCode, opts).RunAndUnwrap();
public static void ValidateByteCode(this FlatClient client, string source, string bytecode, CompileOptsBackend?opts = null) => client.ValidateByteCodeAsync(source, bytecode, opts).RunAndUnwrap();
public static DecodedCalldata DecodeCallDataWithSource(this FlatClient client, string calldata, string function, string sourceCode, CompileOptsBackend?opts = null) => client.DecodeCallDataWithSourceAsync(calldata, sourceCode, function, opts).RunAndUnwrap();
public static JToken DecodeCallResult(this FlatClient client, string sourceCode, string function, string callResult, string callValue, CompileOptsBackend?opts = null) => client.DecodeCallResultAsync(sourceCode, function, callResult, callValue, opts).RunAndUnwrap();
public async Task <ByteCode> CompileAsync(string contractCode, string srcFile, object fileSystem, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { await CheckCompilerBackendAsync(); if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } Contract body = new Contract { Code = contractCode, Options = new CompileOpts() { Backend = opts.Value } }; if (!string.IsNullOrEmpty(srcFile)) { body.Options.SrcFile = srcFile; } if (fileSystem != null) { body.Options.FileSystem = fileSystem; } return(await _compilerClient.CompileContractAsync(body, token)); }
public async Task <DecodedCalldata> DecodeCallDataWithSourceAsync(string calldata, string sourceCode, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { await CheckCompilerBackendAsync(); DecodeCalldataSource body = new DecodeCalldataSource(); body.CallData = calldata; body.Source = sourceCode; if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } body.Options = new CompileOpts() { Backend = opts.Value }; return(await _compilerClient.DecodeCalldataSourceAsync(body, token)); }
public async Task <JToken> DecodeCallResultAsync(string sourceCode, string function, string callResult, string callValue, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { await CheckCompilerBackendAsync(); SophiaCallResultInput body = new SophiaCallResultInput(); body.Source = sourceCode; body.Function = function; if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } body.Options = new CompileOpts() { Backend = opts.Value }; body.CallResult = callResult; body.CallValue = callValue; return(await _compilerClient.DecodeCallResultFixedAsync(body, token)); }
public async Task <Calldata> EncodeCallDataAsync(string sourceCode, string function, List <string> arguments, CompileOptsBackend?opts = null, CancellationToken token = default(CancellationToken)) { await CheckCompilerBackendAsync(); FunctionCallInput body = new FunctionCallInput(); body.Source = sourceCode; body.Function = function; if (opts == null) { opts = _backend == "fate" ? CompileOptsBackend.Fate : CompileOptsBackend.Aevm; } body.Options = new CompileOpts() { Backend = opts.Value }; if (arguments != null) { foreach (string arg in arguments) { body.Arguments.Add(arg); } } return(await _compilerClient.EncodeCalldataAsync(body, token)); }