AccessControlledOffchainAggregator Deployment: Difference between revisions
From Chainlink Community Wiki
No edit summary |
No edit summary |
||
Line 64: | Line 64: | ||
[[File:OCRDeploymentVariables.png|frameless|678x678px]] | [[File:OCRDeploymentVariables.png|frameless|678x678px]] | ||
The values in the above example are not recommended to deploy with. They're just place holder values. Additional context around each of the above values is below: | |||
(the OCR Aggregators' billing values are in bold) | |||
* <code>'''_MAXIMUMGASPRICE'''</code> : This value is used by the contract when calculating the amount of LINK to reimburse for the transmission fee reimbursement -- it's a billing value. In this example, the contract will only reimburse up to 2000GWEI | |||
* <code>'''_REASONABLEGASPRICE'''</code> : This is another billing value. Any transmission that gets on-chain with a gas price below this value is compensated >100%. For example, if a transmission is broadcast at 20 gwei, the Chainlink Node that got the transmission on-chain will be reimbursed for 60 gwei. | |||
* <code>'''_MICROLINKPERETH'''</code> : This is also a billing value; It sets the price ratio of LINK to ETH used to reimburse for transmission costs. | |||
* <code>'''_LINKGWEIPEROBSERVATION'''</code> : This is the fourth billing value; It sets the amount of LINK (in gwei) to pay to all Chainlink Nodes that participate in reaching an agreed upon value of the asset. | |||
* <code>'''_LINKGWEIPERTRANSMISSION'''</code> : This is the final billing value. It sets the transmission "bonus" that he transmitter receives for getting the collection of observations written on-chain. | |||
* <code>_LINK</code> : This is the LINK token contract address for the chain that the feed runs on. | |||
* <code>_MINANSWER</code> : This is the minimum value that the contract will accept. This value is dependent upon the <code>_decimals</code> variable. If you have it set to <code>1000000</code> with <code>8</code> decimals, the lowest value it will accept is <code>0.01</code> | |||
* <code>_MAXANSWER</code> : This is the maximum value that the contract will accept. This value is dependent upon the <code>_decimals</code> variable. If you have it set to <code>100000000000</code> with <code>8</code> decimals, the largest value it will accept is <code>1000.00</code> | |||
* <code>_BILLINGACCESSCONTROLLER</code> : This is the address of the SimpleWriteAccessController that is configured to control which address(es) are allowed to write changes to the OCR Aggregators' billing values provided above. | |||
* <code>_REQUESTERACCESSCONTROLLER</code> : This is teh address of the SimpleWriteAccessController that is configured to control with address(es) are allowed to transmit observations to the OCR Aggregator. You should whitelist all Chainlink Nodes' AccountAddresses that you want on the feed. | |||
* <code>_DECIMALS</code> : This is the number of decimal places used for the on-chain price. Reference the <code>_MINANSWER</code> and <code>_MAXANSER</code> above for examples. | |||
* <code>DESCRIPTION</code> : This is the friendly name of the Aggregator contract. An example would be <code>LINK / USD</code> for the the LINK / USD price feed. | |||
Additional information regarding these values is available at the [[AccessControlledOffchainAggregator Reads]] page. | Additional information regarding these values is available at the [[AccessControlledOffchainAggregator Reads]] page. | ||
The LINK token contract addresses are available at the official [https://docs.chain.link/docs/link-token-contracts/ Chainlink docs page]. | The LINK token contract addresses are available at the official [https://docs.chain.link/docs/link-token-contracts/ Chainlink docs page] as well as here in the wiki's LINK Token Contract Address Index. | ||
Your <code>_BILLINGACCESSCONTROLLER</code> and <code>_REQUESTERACCESSCONTROLLER</code> addresses are the two <code>SimpleWriteAccessController.sol</code> contracts you had previously deployed. | Your <code>_BILLINGACCESSCONTROLLER</code> and <code>_REQUESTERACCESSCONTROLLER</code> addresses are the two <code>SimpleWriteAccessController.sol</code> contracts you had previously deployed. | ||
Note: | |||
Once you have populated all of those fields, go ahead and click Deploy! | Once you have populated all of those fields, go ahead and click Deploy! | ||
[[File:DeployButton.png|frameless]] | [[File:DeployButton.png|frameless]] |
Revision as of 14:14, 30 May 2022
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
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;
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.
It should look like the below image:
With the contract imported into remix, We'll need to compile it
Compile the Contract
Once Pasted into Remix, navigate to the Compile page.
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
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
Once on the Deploy & run transactions tab, we want to be sure that we have the correct contract selected in the drop down menu
With the correct contract deployed, we'll want to open the drop down menu to the right of the Orange Deploy button.
With the drop down expanded, we will want to populate the empty fields with the desired values.
The values in the above example are not recommended to deploy with. They're just place holder values. Additional context around each of the above values is below:
(the OCR Aggregators' billing values are in bold)
_MAXIMUMGASPRICE
: This value is used by the contract when calculating the amount of LINK to reimburse for the transmission fee reimbursement -- it's a billing value. In this example, the contract will only reimburse up to 2000GWEI_REASONABLEGASPRICE
: This is another billing value. Any transmission that gets on-chain with a gas price below this value is compensated >100%. For example, if a transmission is broadcast at 20 gwei, the Chainlink Node that got the transmission on-chain will be reimbursed for 60 gwei._MICROLINKPERETH
: This is also a billing value; It sets the price ratio of LINK to ETH used to reimburse for transmission costs._LINKGWEIPEROBSERVATION
: This is the fourth billing value; It sets the amount of LINK (in gwei) to pay to all Chainlink Nodes that participate in reaching an agreed upon value of the asset._LINKGWEIPERTRANSMISSION
: This is the final billing value. It sets the transmission "bonus" that he transmitter receives for getting the collection of observations written on-chain._LINK
: This is the LINK token contract address for the chain that the feed runs on._MINANSWER
: This is the minimum value that the contract will accept. This value is dependent upon the_decimals
variable. If you have it set to1000000
with8
decimals, the lowest value it will accept is0.01
_MAXANSWER
: This is the maximum value that the contract will accept. This value is dependent upon the_decimals
variable. If you have it set to100000000000
with8
decimals, the largest value it will accept is1000.00
_BILLINGACCESSCONTROLLER
: This is the address of the SimpleWriteAccessController that is configured to control which address(es) are allowed to write changes to the OCR Aggregators' billing values provided above._REQUESTERACCESSCONTROLLER
: This is teh address of the SimpleWriteAccessController that is configured to control with address(es) are allowed to transmit observations to the OCR Aggregator. You should whitelist all Chainlink Nodes' AccountAddresses that you want on the feed._DECIMALS
: This is the number of decimal places used for the on-chain price. Reference the_MINANSWER
and_MAXANSER
above for examples.DESCRIPTION
: This is the friendly name of the Aggregator contract. An example would beLINK / USD
for the the LINK / USD price feed.
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 as well as here in the wiki's LINK Token Contract Address Index.
Your _BILLINGACCESSCONTROLLER
and _REQUESTERACCESSCONTROLLER
addresses are the two SimpleWriteAccessController.sol
contracts you had previously deployed.
Note:
Once you have populated all of those fields, go ahead and click Deploy!