コード例 #1
0
        public BigInteger CreatePlatform(Address from, string name, string externalAddress, Address interopAddress, string fuelSymbol)
        {
            var Runtime = this;

            Runtime.Expect(Runtime.IsRootChain(), "must be root chain");

            Runtime.Expect(from == Runtime.GenesisAddress, "must be genesis");
            Runtime.Expect(Runtime.IsWitness(from), "invalid witness");

            Runtime.Expect(ValidationUtils.IsValidIdentifier(name), "invalid platform name");

            var platformID = Nexus.CreatePlatform(RootStorage, externalAddress, interopAddress, name, fuelSymbol);

            Runtime.Expect(platformID > 0, "creation of platform failed");

            Runtime.Notify(EventKind.PlatformCreate, from, name);
            return(platformID);
        }
コード例 #2
0
ファイル: Runtime.cs プロジェクト: wymoon2690/PhantasmaChain
 public bool CreatePlatform(Address address, string name, string fuelSymbol)
 {
     return(Nexus.CreatePlatform(this.RootStorage, address, name, fuelSymbol));
 }