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})
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})
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))
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))
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} )
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})
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))
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
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))
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)
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
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})