コード例 #1
0
ファイル: fund_vrf.py プロジェクト: spintrade/chainlink-mix
def main():
    dev = accounts.add(config["wallets"]["from_key"])
    # Get the most recent PriceFeed Object
    vrf_contract = VRFConsumer[len(VRFConsumer) - 1]
    interface.LinkTokenInterface(
        config["networks"][network.show_active()]["link_token"]).transfer(
            vrf_contract, 1000000000000000000, {"from": dev})
コード例 #2
0
ファイル: fund_vrf.py プロジェクト: austpryb/fraxses
def main():
    dev = accounts.add(os.getenv(config['wallets']['from_key']))
    # Get the most recent PriceFeed Object
    vrf_contract = VRFConsumer[len(VRFConsumer) - 1]
    interface.LinkTokenInterface(
        config['networks'][network.show_active()]['link_token']).transfer(
            vrf_contract, 1000000000000000000, {'from': dev})
コード例 #3
0
def main():
    dev = accounts.add(os.getenv('PRIVATE_KEY'))
    # Get the most recent PriceFeed Object
    api_contract = APIConsumer[len(APIConsumer) - 1]
    interface.LinkTokenInterface(
        config['networks'][network.show_active()]['link_token']).transfer(
            api_contract, 1000000000000000000, {'from': dev})
    print("Funded {}".format(api_contract.address))
コード例 #4
0
def main():
    dev = accounts.add(config["wallets"]["from_key"])
    # Get the most recent PriceFeed Object
    api_contract = APIConsumer[len(APIConsumer) - 1]
    interface.LinkTokenInterface(
        config["networks"][network.show_active()]["link_token"]).transfer(
            api_contract, 1000000000000000000, {"from": dev})
    print("Funded {}".format(api_contract.address))
コード例 #5
0
def fund_advanced_collectible(nft_contract):
    dev = accounts.add(config["wallets"]["from_key"])
    # Get the most recent PriceFeed Object
    interface.LinkTokenInterface(
        config["networks"][network.show_active()]["link_token"]
    ).transfer(
        nft_contract, config["networks"][network.show_active()]["fee"], {"from": dev}
    )
コード例 #6
0
def main():
    dev = accounts.add(os.getenv(config['wallets']['from_key']))
    # Get the most recent PriceFeed Object
    advanced_collectible = AdvancedCollectible[len(AdvancedCollectible) - 1]
    interface.LinkTokenInterface(
        config['networks'][network.show_active()]['link_token']).transfer(
            advanced_collectible,
            config['networks'][network.show_active()]['fee'], {'from': dev})
コード例 #7
0
def main():
    dev = accounts.add(os.getenv(config['wallets']['from_key']))

    # Get the most recent ExerciseTokenClaim Object
    exercise_token_claim_contract = ExerciseTokenClaim[len(ExerciseTokenClaim) - 1]
    interface.LinkTokenInterface(config['networks'][network.show_active()]['link_token']).transfer(
        exercise_token_claim_contract, 1000000000000000000, {'from': dev})
    print("Funded {}".format(exercise_token_claim_contract.address))
コード例 #8
0
def fund_with_link(contract_address,
                   account=None,
                   link_token=None,
                   amount=1000000000000000000):
    account = account if account else get_account()
    link_token = link_token if link_token else get_contract("link_token")
    tx = interface.LinkTokenInterface(link_token).transfer(
        contract_address, amount, {"from": account})
    print(f"Funded {contract_address}")
    return tx
コード例 #9
0
def main():
    dev = accounts.add(os.getenv(config['wallets']['from_key']))
    GeoDB.deploy(config['networks'][network.show_active()]['geodb_oracle'],
                 config['networks'][network.show_active()]['geodb_jobid'],
                 config['networks'][network.show_active()]['fee'],
                 config['networks'][network.show_active()]['link_token'],
                 {'from': dev})
    geo_db = GeoDB[len(GeoDB) - 1]
    interface.LinkTokenInterface(
        config['networks'][network.show_active()]['link_token']).transfer(
            geo_db, 1000000000000000000, {'from': dev})
    print("Funded {}".format(geo_db.address))
コード例 #10
0
def test_send_random_number_request(deploy_vrf_contract, get_testnet_account):
    # Arrange
    vrf_contract = deploy_vrf_contract
    if network.show_active() != 'kovan':
        pytest.skip('Only works for kovan network')
    interface.LinkTokenInterface(config['networks']['kovan']['link_token']).transfer(
        vrf_contract, 1000000000000000000, {'from': get_testnet_account})
    # Act
    requestId = vrf_contract.getRandomNumber(
        STATIC_RANDOM_SEED, {'from': get_testnet_account})
    # Assert
    assert requestId is not None
    time.sleep(20)
    assert isinstance(vrf_contract.randomResult(), int)
コード例 #11
0
def test_send_api_request(deploy_api_contract, get_testnet_account):
    # Arrange
    api_contract = deploy_api_contract
    if network.show_active() != 'kovan':
        pytest.skip('Only works for kovan network')
    interface.LinkTokenInterface(
        config['networks']['kovan']['link_token']).transfer(
            api_contract, 1000000000000000000, {'from': get_testnet_account})
    # Act
    requestId = api_contract.requestVolumeData({'from': get_testnet_account})
    # Assert
    assert requestId is not None
    time.sleep(20)
    assert isinstance(api_contract.volume(), int)
    assert api_contract.volume() > 0
コード例 #12
0
def fund_advanced_collectible(nft_contract):
    dev = accounts.add(config['wallets']['from_key'])
    link_token = interface.LinkTokenInterface(
        config['networks'][network.show_active()]['link_token'])
    link_token.transfer(nft_contract, 1000000000000000000, {"from": dev})