コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
ファイル: ongBet1.py プロジェクト: skyinglyh1/ong-bets
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
ファイル: oracle.py プロジェクト: vadimcheck/ontology-oracle
def MigrateContract(code, needStorage, name, version, author, email,
                    description):
    RequireWitness(Admin)
    res = Migrate(code, needStorage, name, version, author, email, description)
    Require(res)
    return True