📌Football Player Feed Contract
Introduction
The Football Player Feed Oracle is a decentralized smart contract designed to fetch real-time football player data and provide it to other smart contracts. Acting as a bridge between blockchain applications and external data sources, this oracle enables smart contracts to access and utilize football player information securely and transparently.
Technical Description
The Football Player Feed Oracle is implemented as a smart contract on a blockchain platform such as Ethereum. It listens for player data requests, fetches real-time data from an external sports API, and stores the data in a decentralized manner. This ensures accessibility, security, and immutability.
Workflow
A user invokes the contract by providing a
player_id
.The contract makes an external API request to fetch player data.
The retrieved data is stored in the contract’s storage and an event is triggered.
Other smart contracts or users can monitor this event and retrieve the stored player data.
Key Features
Secure and tamper-proof storage of football player data.
Transparent and publicly accessible data.
Pay-per-use model for requesting player information.
Event-driven updates that notify subscribers when new data is available.
Usage
To interact with the Football Player Feed Oracle, follow these steps:
1. Deploy the Contract
Deploy the contract to the blockchain using the following Oracle Contract address:
2. Request Football Player Data
Call the function:
player_id
: The ID of the football player whose data is being requested.This is a payable function, meaning the user must pay a certain amount of Ether to access the player data.
On successful execution, the function returns a success message.
3. Retrieve Football Player Data
Once the data is available, call:
player_id
: The request ID received from the previous function.This function retrieves the latest player data, including player name, nationality, and field position.
Smart Contract Implementation
Contract Functions
1. Constructor
Initializes the contract with the address of the Oracle smart contract.
2. Request Football Player Data
Allows users to request data on a specific football player.
Requires a payable transaction where users must send Ether to access the data.
Takes in
_player_id
(player identifier) as a parameter.Calls the
requestPlayer
function on the Oracle contract to fetch the data.Returns a success message if the request is processed correctly.
3. Retrieve Football Player Data
Fetches stored player data for a given player ID.
Calls
getPlayerDetails
function on the Oracle contract.Returns:
player_name
: The player's name.club
: The player's club.age
: The player's age.
Last updated