Exemple #1
0
        private static ExecutionState Runtime_MintToken(RuntimeVM vm)
        {
            vm.ExpectStackSize(4);

            var source      = vm.PopAddress();
            var destination = vm.PopAddress();

            var symbol = vm.PopString("symbol");

            var rom = vm.PopBytes("rom");
            var ram = vm.PopBytes("ram");

            BigInteger seriesID;

            if (vm.ProtocolVersion >= 4)
            {
                seriesID = vm.PopNumber("series");
            }
            else
            {
                seriesID = 0;
            }

            var tokenID = vm.MintToken(symbol, source, destination, rom, ram, seriesID);

            var result = new VMObject();

            result.SetValue(tokenID);
            vm.Stack.Push(result);

            return(ExecutionState.Running);
        }
Exemple #2
0
        private static ExecutionState Runtime_MintToken(RuntimeVM Runtime)
        {
            ExpectStackSize(Runtime, 4);

            VMObject temp;

            var source      = PopAddress(Runtime);
            var destination = PopAddress(Runtime);

            temp = Runtime.Stack.Pop();
            Runtime.Expect(temp.Type == VMType.String, "expected string for symbol");
            var symbol = temp.AsString();

            temp = Runtime.Stack.Pop();
            Runtime.Expect(temp.Type == VMType.Bytes, "expected bytes for rom");
            var rom = temp.AsByteArray();

            temp = Runtime.Stack.Pop();
            Runtime.Expect(temp.Type == VMType.Bytes, "expected bytes for ram");
            var ram = temp.AsByteArray();

            var tokenID = Runtime.MintToken(symbol, source, destination, rom, ram);

            var result = new VMObject();

            result.SetValue(tokenID);
            Runtime.Stack.Push(result);

            return(ExecutionState.Running);
        }