Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ SOCKET Protocol is the first chain-abstraction protocol, enabling developers to
SOCKET is a chain-abstraction protocol, not a network(chain/rollup). Using a combination of offchain agents(watchers, transmitters) and onchain contracts(switchboards) it enables application-builders to build truly chain-abstracted protocols.

Find more information at [docs](https://docs.socket.tech)

# Code Guidelines:

- always inherit at the end
- always add storage to Storage contracts
- Storage contracts should have gaps before and after
- update gaps after every change
- update version after every change
- never remove code
- inherited contracts should have gaps at the end to avoid storage collision
10 changes: 6 additions & 4 deletions hardhat-scripts/deploy/2.roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ async function setRoleForContract(
);

if (!hasRole) {
let tx = await contract.grantRole(roleHash, targetAddress);
let tx = await contract.grantRole(roleHash, targetAddress, {
...getOverrides(chain),
});
console.log(
`granting ${roleName} role to ${targetAddress} for ${contractName}`,
chain,
Expand All @@ -55,10 +57,10 @@ async function setRoleForContract(
}
}

async function getSigner(chain: number) {
async function getSigner(chain: number, isWatcher: boolean = false) {
const providerInstance = getProviderFromChainSlug(chain);
const signer: Wallet = new ethers.Wallet(
process.env.SOCKET_SIGNER_KEY as string,
isWatcher ? process.env.WATCHER_PRIVATE_KEY as string : process.env.SOCKET_SIGNER_KEY as string,
providerInstance
);
return signer;
Expand Down Expand Up @@ -94,7 +96,7 @@ async function setRolesForOnChain(chain: number, addresses: DeploymentAddresses)

async function setRolesForEVMx(addresses: DeploymentAddresses) {
const chainAddresses: ChainAddressesObj = (addresses[EVMX_CHAIN_ID] ?? {}) as ChainAddressesObj;
const signer = await getSigner(EVMX_CHAIN_ID);
const signer = await getSigner(EVMX_CHAIN_ID, true);

const contractAddress = chainAddresses[EVMxCoreContracts.WatcherPrecompile];
if (!contractAddress) return;
Expand Down
Loading