def MigrateContract(code): """ Note that the existing contract will be replaced by the newly migrated contract :param code: your avm code :return: """ Migrate(code, "", "", "", "", "", "", "", "") Notify(["Migrate successfully"]) return True
def MigrateContract(code): """ Note that the existing contract will not replaced by the newly migrated contract :param code: :return: """ Migrate(code, "", "", "", "", "", "", "", "") Notify(["Migrate"]) return True
def migrateContract(code, needStorage, name, version, author, email, description, newReversedContractHash): RequireWitness(Admin) res = _transferONGFromContact(newReversedContractHash, getTotalONG()) Require(res) if res == True: res = Migrate(code, needStorage, name, version, author, email, description) Require(res) Notify(["Migrate Contract successfully", Admin, GetTime()]) return True else: Notify(["MigrateContractError", "transfer ONG to new contract error"]) return False
def migrateContract(code, needStorage, name, version, author, email, description, newContractHash): RequireWitness(Admin) param = state(ContractAddress) totalOngAmount = Invoke(0, ONGAddress, 'balanceOf', param) res = _transferONGFromContact(newContractHash, totalOngAmount) Require(res) if res == True: res = Migrate(code, needStorage, name, version, author, email, description) Require(res) Notify(["Migrate Contract successfully", Admin, GetTime()]) return True else: Notify(["MigrateContractError", "transfer ONG to new contract error"]) return False
def migrateContract(code, needStorage, name, version, author, email, description, newReversedContractHash): RequireWitness(Admin) param = state(ContractAddress) totalOngAmount = Invoke(0, ONGAddress, 'balanceOf', param) if totalOngAmount > 0: res = _transferONGFromContact(newReversedContractHash, totalOngAmount) Require(res) revesedContractAddress = Get(GetContext(), LUCKY_CONTRACT_HASH_KEY) params = [ContractAddress] totalLuckyAmount = DynamicAppCall(revesedContractAddress, "balanceOf", params) if totalLuckyAmount > 0: params = [ContractAddress, newReversedContractHash, totalLuckyAmount] res = DynamicAppCall(revesedContractAddress, "transfer", params) Require(res) res = Migrate(code, needStorage, name, version, author, email, description) Require(res) Notify(["Migrate Contract successfully"]) return True
def migrateContract(code, needStorage, name, version, author, email, description): RequireWitness(Admin) Migrate(code, needStorage, name, version, author, email, description) Notify(["Migrate Contract successfully", Admin, GetTime()]) return True
def MigrateContract(code, needStorage, name, version, author, email, description): RequireWitness(Admin) res = Migrate(code, needStorage, name, version, author, email, description) Require(res) return True