Actions

AccessControlledOffchainAggregator Deployment

From Chainlink Community Wiki

Revision as of 21:31, 27 May 2022 by Devtrace (talk | contribs)

The purpose of this page is to provide highly detailed instructions on how to deploy the AccessControlledOffchainAggregator.sol contract

Deploying the AccessControlledOffchainAggregator Via Remix

Import the Contract into Remix

Navigate to remix.ethereum.org

Once there, create a new doc by clicking on the little page icon

NewRemixProject.png

You can try to import the contract from github, but I've had mixed results from that.

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "https://github.com/DexTrac-Devlin/single-ocr/blob/main/condensed_AccessControlledOffchainAggregator.sol";

Due to the mixed experience I've had, this guide will assume that you have simply copy and pasted the flattened contract from the below link.

https://raw.githubusercontent.com/DexTrac-Devlin/single-ocr/main/condensed_AccessControlledOffchainAggregator.sol

It should look like the below image:

ImportedOCRContract.png

With the contract imported into remix, We'll need to compile it


Compile the Contract

Once Pasted into Remix, navigate to the Compile page.

NavigateToCompile.png


In the image above, you can see that the COMPILER version is 0.7.6+...

When deploying the AccessControlledOffchainAggregator.sol contract, we want to be sure that the version selected here is 0.7.6+commit.7338295f

With the correct version selected, go ahead and compile the contract by clicking the blue button with the circular arrows

RemixCompileButton.png

Once that succeeds, we can then deploy the contract.

Note: You'll likely see some Orange warning boxes when compiling. For the sake of this doc, we'll ignore those.


Deploy the Contract

With the contract compiled, we then need to navigate to the Deploy & run transactions tab

DeployContractPage.png

Once on the Deploy & run transactions tab, we want to be sure that we have the correct contract selected in the drop down menu

SelectAccessControlledOffchainAggregator.png

With the correct contract deployed, we'll want to open the drop down menu to the right of the Orange Deploy button.

ExpandDeploymentVariables.png

With the drop down expanded, we will want to populate the empty fields with the desired values.

Additional information regarding these values is available at the AccessControlledOffchainAggregator Reads page.

The LINK token contract addresses are available at the official Chainlink docs page.

Your _BILLINGACCESSCONTROLLER and _REQUESTERACCESSCONTROLLER addresses are the two SimpleWriteAccessController.sol contracts you had previously deployed.

Once you have populated all of those fields, go ahead and click Deploy!

DeployButton.png