// Factory methods // Template: NPCLevel1Part2_cs.txt private static NPCNEP5FundingRound _Initialize(NPCNEP5FundingRound e) { e._totalSupply = 0; e._startTimestamp = 0; e._endTimestamp = 0; e._state = NeoEntityModel.EntityState.NULL; if (NeoTrace.RUNTIME) { LogExt("_Initialize(e).NPCNEP5FundingRound", e); } return(e); }
public static NPCNEP5FundingRound New() { NPCNEP5FundingRound e = new NPCNEP5FundingRound(); _Initialize(e); if (NeoTrace.RUNTIME) { LogExt("New().NPCNEP5FundingRound", e); } return(e); }
public static NPCNEP5FundingRound Missing() { NPCNEP5FundingRound e = new NPCNEP5FundingRound(); e._totalSupply = 0; e._startTimestamp = 0; e._endTimestamp = 0; e._state = NeoEntityModel.EntityState.MISSING; if (NeoTrace.RUNTIME) { LogExt("Missing().NPCNEP5FundingRound", e); } return(e); }
public static NPCNEP5FundingRound New(BigInteger TotalSupply, BigInteger StartTimestamp, BigInteger EndTimestamp) { NPCNEP5FundingRound e = new NPCNEP5FundingRound(); e._totalSupply = TotalSupply; e._startTimestamp = StartTimestamp; e._endTimestamp = EndTimestamp; e._state = NeoEntityModel.EntityState.INIT; if (NeoTrace.RUNTIME) { LogExt("New(.,.).NPCNEP5FundingRound", e); } return(e); }
public static NPCNEP5FundingRound Get(string key) { if (key.Length == 0) { return(Null()); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; string _skeyTag = key + _classKeyTag; NPCNEP5FundingRound e; byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA); if (NeoTrace.RUNTIME) { TraceRuntime("Get(skey).NPCNEP5FundingRound.bsta", bsta.Length, bsta); } if (bsta.Length == 0) { e = NPCNEP5FundingRound.Missing(); } else // not MISSING { int ista = (int)bsta.AsBigInteger(); NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista; e = new NPCNEP5FundingRound(); BigInteger TotalSupply = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sTotalSupply).AsBigInteger(); //NPCLevel2IGet_cs.txt BigInteger StartTimestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sStartTimestamp).AsBigInteger(); //NPCLevel2IGet_cs.txt BigInteger EndTimestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sEndTimestamp).AsBigInteger(); //NPCLevel2IGet_cs.txt if (NeoTrace.RUNTIME) { TraceRuntime("Get(skey).e._totalSupply, e._startTimestamp, e._endTimestamp", e._totalSupply, e._startTimestamp, e._endTimestamp); // Template: NPCLevel2Part2_cs.txt } e._totalSupply = TotalSupply; e._startTimestamp = StartTimestamp; e._endTimestamp = EndTimestamp; e._state = sta; e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */ } if (NeoTrace.RUNTIME) { LogExt("Get(skey).NPCNEP5FundingRound", e); } return(e); }
public static NPCNEP5FundingRound Get(byte[] key) { if (key.Length == 0) { return(Null()); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; byte[] _bkeyTag = Helper.Concat(key, _bclassKeyTag); NPCNEP5FundingRound e; byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA)); if (NeoTrace.RUNTIME) { TraceRuntime("Get(bkey).bsta", bsta.Length, bsta); } if (bsta.Length == 0) { e = NPCNEP5FundingRound.Missing(); } else // not MISSING { int ista = (int)bsta.AsBigInteger(); NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista; e = new NPCNEP5FundingRound(); BigInteger TotalSupply = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bTotalSupply)).AsBigInteger(); //NPCLevel2GGet_cs.txt BigInteger StartTimestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bStartTimestamp)).AsBigInteger(); //NPCLevel2GGet_cs.txt BigInteger EndTimestamp = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bEndTimestamp)).AsBigInteger(); //NPCLevel2GGet_cs.txt e._totalSupply = TotalSupply; e._startTimestamp = StartTimestamp; e._endTimestamp = EndTimestamp; // Template: NPCLevel2HGet_cs.txt e._state = sta; e._state = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */ } if (NeoTrace.RUNTIME) { LogExt("Get(bkey).NPCNEP5FundingRound", e); } return(e); }
public static bool Put(NPCNEP5FundingRound e, byte[] key) { if (key.Length == 0) { return(false); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; byte[] _bkeyTag = Helper.Concat(key, _bclassKeyTag); e._state = NeoEntityModel.EntityState.PUTTED; Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bSTA), e._state.AsBigInteger()); Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bTotalSupply), e._totalSupply); // Template: NPCLevel2CPut_cs.txt Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bStartTimestamp), e._startTimestamp); // Template: NPCLevel2CPut_cs.txt Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bEndTimestamp), e._endTimestamp); // Template: NPCLevel2CPut_cs.txt if (NeoTrace.RUNTIME) { LogExt("Put(bkey).NPCNEP5FundingRound", e); // Template: NPCLevel2DPut_cs.txt } return(true); }
public static bool Put(NPCNEP5FundingRound e, string key) { if (key.Length == 0) { return(false); } if (NeoTrace.RUNTIME) { LogExt("Put(skey).NPCNEP5FundingRound", e); } Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext; string _skeyTag = key + _classKeyTag; if (NeoTrace.RUNTIME) { TraceRuntime("Put(skey)._skeyTag", _skeyTag); } e._state = NeoEntityModel.EntityState.PUTTED; BigInteger bis = e._state.AsBigInteger(); if (NeoTrace.RUNTIME) { TraceRuntime("Put(skey).bis", bis); } Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sSTA, bis); Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sTotalSupply, e._totalSupply); // Template: NPCLevel2EPut_cs.txt Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sStartTimestamp, e._startTimestamp); // Template: NPCLevel2EPut_cs.txt Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sEndTimestamp, e._endTimestamp); // Template: NPCLevel2EPut_cs.txt if (NeoTrace.RUNTIME) { LogExt("Put(skey).NPCNEP5FundingRound", e); // Template: NPCLevel2FGet_cs.txt } return(true); }
// Accessors public static void SetTotalSupply(NPCNEP5FundingRound e, BigInteger value) // Template: NPCLevel1SetXGetX_cs.txt { e._totalSupply = value; e._state = NeoEntityModel.EntityState.SET; }
// Persistable methods public static bool IsMissing(NPCNEP5FundingRound e) { return(e._state == NeoEntityModel.EntityState.MISSING); }
public static void Set(NPCNEP5FundingRound e, BigInteger TotalSupply, BigInteger StartTimestamp, BigInteger EndTimestamp) // Template: NPCLevel1Set_cs.txt { e._totalSupply = TotalSupply; e._startTimestamp = StartTimestamp; e._endTimestamp = EndTimestamp; e._state = NeoEntityModel.EntityState.SET; }
public static BigInteger GetEndTimestamp(NPCNEP5FundingRound e) { return(e._endTimestamp); }
public static void SetEndTimestamp(NPCNEP5FundingRound e, BigInteger value) // Template: NPCLevel1SetXGetX_cs.txt { e._endTimestamp = value; e._state = NeoEntityModel.EntityState.SET; }
public static BigInteger GetStartTimestamp(NPCNEP5FundingRound e) { return(e._startTimestamp); }
public static BigInteger GetTotalSupply(NPCNEP5FundingRound e) { return(e._totalSupply); }
public static void LogExt(string label, NPCNEP5FundingRound e) { TraceRuntime(label, e._totalSupply, e._startTimestamp, e._endTimestamp, e._state); }
// EntityState wrapper methods public static bool IsNull(NPCNEP5FundingRound e) { return(e._state == NeoEntityModel.EntityState.NULL); }