Example EVM Price Feed Contract Deployment
A price feed contract deployed on an EVM chain to post data requests to SEDA in a permissionless manner.
Deploying and testing your contract using Hardhat is a straightforward process, especially with the deployment scripts provided in the SEDA Starter Kit. We've implemented a deployment script using Hardhat Ignition to simplify the steps.
Step 1: Set Up the Environment
Before deploying, ensure that your environment is configured correctly with the required .env, hardhat.config.ts, and seda.config.ts files. These files contain important variables and settings for the deployment process.
.env
.envThe .env file holds sensitive data such as private keys and contract IDs. Ensure that you fill in the required values:
ORACLE_PROGRAM_ID=YOUR_ORACLE_PROGRAM_ID
EVM_PRIVATE_KEY=YOUR_EVM_PRIVATE_KEY
# Optional
BASE_SEPOLIA_ETHERSCAN_API_KEY=YOUR_BASESCAN_API_KEYseda.config.ts
seda.config.tsThis configuration file specifies the SedaProver contract addresses for different networks. Below is an example configuration for several supported networks:
export interface SedaConfig {
coreAddress: string;
}
export const networkConfigs: { [network: string]: SedaConfig } = {
// Proxy Core Addresses (SEDA mainnet)
base: {
coreAddress: '0xDF1fb5ACe711B16D90FC45776fF1bF02CEBc245D',
},
// Proxy Core Addresses (SEDA testnet)
baseSepolia: {
coreAddress: '0xffDB1d9bBE4D56780143428450c4C2058061E6F3',
},
superseedSepolia: {
coreAddress: '0xE08989FB730E072689b4885c2a62AE5f1fc787F2',
},
chiado: {
coreAddress: '0xbe2ace709959C121759d553cACf7e6532C25a3aA',
},
hyperliquidPurrsec: {
coreAddress: '0x23c01fe3C1b7409A98bBd39a7c9e5C2263C64b59',
},
};
Make sure to add the correct coreAddress for each network you're working with. You can find the latest deployed addresses here:
Hardhat Network Setup
Your Hardhat network configuration should follow the standard setup. Refer to the Hardhat documentation for detailed guidance on configuring networks in hardhat.config.ts.
Step 2: Deploy the Contract
Once your environment is set up, use Hardhat to deploy the PriceFeed contract. Ensure that you’ve defined the necessary environment variables, including ORACLE_PROGRAM_ID and EVM_PRIVATE_KEY, which are essential for deployment.
Run the following command to deploy the contract using Hardhat Ignition:
After confirming the deployment, Hardhat Ignition will execute the deployment and provide the deployed contract address:
If you use the --verify flag, Hardhat will also verify the contract on the blockchain explorer, providing a link to view the verified contract code:
Step 3: Post a Data Request
Once the contract is deployed, you can start posting data requests and interacting with the PriceFeed contract.
The starter kit includes tasks to simplify this process. To view available tasks, run:
For example, to post a data request on Base Sepolia, run:
Output:
If not specified, the script will fetch the contract address from the previous deployments.
Step 4: Read the Latest Answer
After the data request has been processed by the SEDA network, you can retrieve the result by calling the latestAnswer function. This will fetch the data from the network:
Output:
With these steps, you’ve successfully deployed, posted data requests, and retrieved results using the PriceFeed contract on the SEDA network. Combining these deployment and interaction scripts allows for a smooth integration into your application.
Last updated
Was this helpful?

