2023-09-15 16:27:08 +02:00
|
|
|
|
using Core;
|
|
|
|
|
|
using GethPlugin;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CodexContractsPlugin
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CodexContractsPlugin : IProjectPlugin, IHasLogPrefix, IHasMetadata
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IPluginTools tools;
|
|
|
|
|
|
private readonly CodexContractsStarter starter;
|
|
|
|
|
|
|
|
|
|
|
|
public CodexContractsPlugin(IPluginTools tools)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.tools = tools;
|
2025-04-22 17:11:34 +02:00
|
|
|
|
starter = new CodexContractsStarter(tools);
|
2023-09-15 16:27:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string LogPrefix => "(CodexContracts) ";
|
|
|
|
|
|
|
2025-04-18 15:47:44 +02:00
|
|
|
|
public void Awake(IPluginAccess access)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:27:08 +02:00
|
|
|
|
public void Announce()
|
|
|
|
|
|
{
|
2023-09-19 13:58:45 +02:00
|
|
|
|
tools.GetLog().Log($"Loaded Codex-Marketplace SmartContracts");
|
2023-09-15 16:27:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddMetadata(IAddMetadata metadata)
|
|
|
|
|
|
{
|
2025-04-22 17:11:34 +02:00
|
|
|
|
metadata.Add("codexcontractsid", "dynamic");
|
2023-09-15 16:27:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Decommission()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-22 17:11:34 +02:00
|
|
|
|
public CodexContractsDeployment DeployContracts(CoreInterface ci, IGethNode gethNode, CodexClient.DebugInfoVersion versionInfo)
|
2023-09-15 16:27:08 +02:00
|
|
|
|
{
|
2025-04-22 17:11:34 +02:00
|
|
|
|
return starter.Deploy(ci, gethNode, versionInfo);
|
2023-09-20 09:16:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-30 13:30:14 +01:00
|
|
|
|
public ICodexContracts WrapDeploy(IGethNode gethNode, CodexContractsDeployment deployment)
|
2023-09-20 09:16:57 +02:00
|
|
|
|
{
|
2023-09-20 10:13:29 +02:00
|
|
|
|
deployment = SerializeGate.Gate(deployment);
|
2023-10-30 13:30:14 +01:00
|
|
|
|
return starter.Wrap(gethNode, deployment);
|
2023-09-15 16:27:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|