Actions

SimpleWriteAccessController Deployment

From Chainlink Community Wiki

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

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

If you're here to deploy your own OCR Aggregator, be sure to keep track of which SimpleWriteAccessController you want to use for each purpose.

Deploying the SimpleWriteAccessController 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

Once you have an empty doc, paste in the below referenece

// SPDX-License-Identifier: MIT

pragma solidity 0.8.0;

import "@chainlink/contracts/src/v0.8/SimpleWriteAccessController.sol";

It should look like the below image:

ImportedSimpleWriteAccessController.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 SimpleWriteAccessController.sol contract, we want to be sure that the version selected here is 0.8.0+commit.c7dfd78e

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.


Deploy the Contract

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

DeployContractPage.png

Once here, we want to be sure to adjust a couple things before deploying the contract.

First, assuming we are deploying this contract via metamask we want to change the ENVIRONMENT to Injected Web3

ChangeDeploymentEnvironment.png

The last thing we need to do before deploying the contract is change the CONTRACT we're actually deploying.

Just click the drop down and select SimpleWriteAccessController

SelectSimpleWriteAccessController.png

Next we just click the Orange deploy button!

DeployButton.png


Interacting With Deployed Contract

If you want to add a specific address or addresses to the to the SimpleWriteAccessController, we can drop down the addAccess section and paste in the desired address(es).

Once you've done that, click the transact button

AddAccess.png