示例#1
0
 public TokenSeries(BigInteger mintCount, BigInteger maxSupply, TokenSeriesMode mode, byte[] script, ContractInterface ABI, byte[] ROM)
 {
     MintCount = mintCount;
     MaxSupply = maxSupply;
     Mode      = mode;
     Script    = script;
     this.ABI  = ABI;
     SetROM(ROM);
 }
示例#2
0
        public void UpdateTokenID(TokenSeriesMode mode)
        {
            byte[] bytes;

            switch (mode)
            {
            case TokenSeriesMode.Unique: bytes = ROM; break;

            case TokenSeriesMode.Duplicated: bytes = ROM.Concat(SeriesID.ToUnsignedByteArray()).Concat(MintID.ToUnsignedByteArray()).ToArray(); break;

            default:
                throw new ChainException($"Generation of tokenID for Series with {mode} is not implemented");
            }

            this.TokenID = Hash.FromBytes(bytes);
        }
示例#3
0
        public TokenContent(BigInteger seriesID, BigInteger mintID, string currentChain, Address creator, Address currentOwner, byte[] ROM, byte[] RAM, Timestamp timestamp, IEnumerable <TokenInfusion> infusion, TokenSeriesMode mode) : this()
        {
            this.SeriesID  = seriesID;
            this.MintID    = mintID;
            this.Creator   = creator;
            CurrentChain   = currentChain;
            CurrentOwner   = currentOwner;
            this.ROM       = ROM;
            this.RAM       = RAM;
            this.Timestamp = timestamp;
            this.Infusion  = infusion != null?infusion.ToArray() : new TokenInfusion[0];

            UpdateTokenID(mode);
        }