Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
65e7c11
update
aelmanaa Dec 7, 2024
c5a2e34
update
aelmanaa Dec 7, 2024
3e525fd
update
aelmanaa Dec 7, 2024
53f0620
update
aelmanaa Dec 7, 2024
10ad55c
update
aelmanaa Dec 7, 2024
9af46e6
update
aelmanaa Dec 7, 2024
44d2f7b
update
aelmanaa Dec 7, 2024
2114ab9
update
aelmanaa Dec 7, 2024
7d18981
update
aelmanaa Dec 7, 2024
785f603
update
aelmanaa Dec 7, 2024
cf582a8
update
aelmanaa Dec 8, 2024
3c276c2
update
aelmanaa Dec 8, 2024
3942210
update
aelmanaa Dec 8, 2024
494b1c7
update
aelmanaa Dec 8, 2024
583064f
update
aelmanaa Dec 8, 2024
9b7032f
update
aelmanaa Dec 8, 2024
1a6b8d5
update
aelmanaa Dec 8, 2024
b3bf9e2
update
aelmanaa Dec 8, 2024
38ff9d1
update
aelmanaa Dec 8, 2024
eb7747b
update
aelmanaa Dec 8, 2024
d2fa01f
update
aelmanaa Dec 8, 2024
fc36e05
update
aelmanaa Dec 8, 2024
bf290b6
update
aelmanaa Dec 8, 2024
c567d7c
update
aelmanaa Dec 8, 2024
54e800b
update
aelmanaa Dec 8, 2024
06e34ae
update
aelmanaa Dec 8, 2024
ebfc402
update
aelmanaa Dec 8, 2024
3029c49
update
aelmanaa Dec 8, 2024
1c69631
update
aelmanaa Dec 8, 2024
1c2c742
update
aelmanaa Dec 9, 2024
0c98b15
update
aelmanaa Dec 9, 2024
5ebdf06
update
aelmanaa Dec 9, 2024
ac35c85
update
aelmanaa Dec 9, 2024
9887c50
update
aelmanaa Dec 9, 2024
0d1cee1
update
aelmanaa Dec 9, 2024
35a391b
update
aelmanaa Dec 9, 2024
ccd5322
update
aelmanaa Dec 9, 2024
8823c99
update
aelmanaa Dec 9, 2024
a9a1498
update
aelmanaa Dec 9, 2024
4210429
update
aelmanaa Dec 9, 2024
e37307a
update
aelmanaa Dec 9, 2024
c2b308d
update
aelmanaa Dec 9, 2024
38f7f08
update
aelmanaa Dec 9, 2024
7f29b37
update
aelmanaa Dec 9, 2024
d6b9d5a
update
aelmanaa Dec 9, 2024
83e92ce
update
aelmanaa Dec 9, 2024
d8616e3
update
aelmanaa Dec 9, 2024
225c994
update
aelmanaa Dec 9, 2024
57fdfaf
update
aelmanaa Dec 9, 2024
bc2934c
update
aelmanaa Dec 9, 2024
7bba5ca
update
aelmanaa Dec 9, 2024
322be15
update
aelmanaa Dec 9, 2024
703f0b4
update
aelmanaa Dec 9, 2024
cf94cda
update
aelmanaa Dec 9, 2024
5752772
update
aelmanaa Dec 9, 2024
5d5351a
update
aelmanaa Dec 9, 2024
7cb8bc7
update
aelmanaa Dec 9, 2024
6535d9f
update
aelmanaa Dec 9, 2024
1488e79
fix store
aelmanaa Dec 10, 2024
bc1bfb6
fix store
aelmanaa Dec 10, 2024
c1767d6
fix update
aelmanaa Dec 10, 2024
7ac83d9
fix update
aelmanaa Dec 10, 2024
65ce749
fix update
aelmanaa Dec 10, 2024
605dc2b
fix update
aelmanaa Dec 10, 2024
91076b4
navigation
aelmanaa Dec 10, 2024
a065ef8
update urls
aelmanaa Dec 10, 2024
f04223e
update
aelmanaa Dec 11, 2024
a2b6ddf
update
aelmanaa Dec 11, 2024
badea6a
update
aelmanaa Dec 11, 2024
579db1f
update
aelmanaa Dec 11, 2024
82e94ac
update
aelmanaa Dec 11, 2024
92ee93a
verification
aelmanaa Dec 11, 2024
76d1f2c
callout
aelmanaa Dec 11, 2024
b8a2afb
callout
aelmanaa Dec 11, 2024
31bd24a
verify rate
aelmanaa Dec 11, 2024
4135585
verify rate
aelmanaa Dec 11, 2024
6754a41
verify rate
aelmanaa Dec 11, 2024
08c867b
update
aelmanaa Dec 11, 2024
cd2f469
update
aelmanaa Dec 11, 2024
24aad6a
update
aelmanaa Dec 11, 2024
bd8004f
update
aelmanaa Dec 11, 2024
3c1f59e
update
aelmanaa Dec 11, 2024
5921ab1
update
aelmanaa Dec 11, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
.steps {
padding-left: var(--space-4x);
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-4x);
}

.instructions {
padding-left: var(--space-6x);
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-3x);
}

.contractInfo {
display: flex;
align-items: center;
gap: var(--space-3x);
padding: var(--space-3x);
background: var(--color-background-secondary);
border: 1px solid var(--color-border);
border-radius: var(--border-radius);
margin-bottom: var(--space-3x);
}

.contractInfo strong {
color: var(--color-text-primary);
font-weight: 600;
}

.actionDetails {
display: flex;
flex-direction: column;
gap: var(--space-2x);
}

.actionTitle {
font-weight: 500;
color: var(--color-text-primary);
}

.actionTitle code {
font-family: var(--font-mono);
color: var(--color-text-primary);
background: var(--color-background);
padding: var(--space-1x) var(--space-2x);
border-radius: 4px;
font-size: var(--font-size-sm);
}

.parameter {
display: grid;
grid-template-columns: 120px 1fr;
gap: var(--space-3x);
align-items: center;
padding: var(--space-2x) var(--space-3x);
background: var(--color-background-secondary);
border: 1px solid var(--color-border);
border-radius: var(--border-radius);
}

.paramName {
font-family: var(--font-mono);
font-size: var(--font-size-sm);
color: var(--color-text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
.parameter {
grid-template-columns: 1fr;
gap: var(--space-2x);
}
}

.functionDescription {
color: var(--color-text-secondary);
font-size: var(--font-size-sm);
margin: var(--space-2x) 0;
}

.parameters {
margin-top: var(--space-2x);
}

.functionCall {
background: var(--color-background-secondary);
border: 1px solid var(--color-border);
border-radius: var(--border-radius);
padding: var(--space-4x);
margin: var(--space-2x) 0;
}

.functionHeader {
margin-bottom: var(--space-3x);
}

.functionName {
font-family: var(--font-mono);
font-size: var(--font-size-lg);
color: var(--color-text-primary);
background: var(--color-background);
padding: var(--space-1x) var(--space-2x);
border-radius: 4px;
}

.functionPurpose {
color: var(--color-text);
margin-top: var(--space-2x);
font-size: var(--font-size-base);
}

.functionRequirement {
color: var(--color-warning);
font-size: var(--font-size-sm);
margin-bottom: var(--space-3x);
}

.parametersSection {
border-top: 1px solid var(--color-border);
padding-top: var(--space-3x);
}

.parametersTitle {
font-weight: 600;
color: var(--color-text-primary);
margin-bottom: var(--space-2x);
}
134 changes: 134 additions & 0 deletions src/components/CCIP/TutorialBlockchainSelector/AdminSetupStep.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import { useStore } from "@nanostores/react"
import { laneStore } from "@stores/lanes"
import { NetworkCheck } from "../TutorialSetup/NetworkCheck"
import { TutorialCard } from "../TutorialSetup/TutorialCard"
import { TutorialStep } from "../TutorialSetup/TutorialStep"
import { NetworkAddress } from "./NetworkAddress"
import { StepCheckbox } from "../TutorialProgress/StepCheckbox"
import { SolidityParam } from "../TutorialSetup/SolidityParam"
import styles from "./AdminSetupStep.module.css"

interface AdminSetupStepProps {
chain: "source" | "destination"
}

export const AdminSetupStep = ({ chain }: AdminSetupStepProps) => {
const state = useStore(laneStore)
const network = chain === "source" ? state.sourceNetwork : state.destinationNetwork
const networkInfo = network ? { name: network.name, logo: network.logo } : { name: "loading..." }
const stepId = chain === "source" ? "sourceChain" : "destinationChain"
const tokenAddress = chain === "source" ? state.sourceContracts.token : state.destinationContracts.token

const getSubStepId = (subStepId: string) => `${stepId}-${subStepId}`

const content = (
<>
<NetworkCheck network={networkInfo} />

<ol className={styles.steps}>
<TutorialStep
id={getSubStepId("admin-claimed")}
title="Register as Admin"
checkbox={<StepCheckbox stepId={stepId} subStepId="admin-claimed" />}
>
<ol className={styles.instructions}>
<li>
In the "Deploy & Run Transactions" tab, select <strong>RegistryModuleOwnerCustom</strong> contract
</li>
<li>
Click "At Address" with:
<div className={styles.contractInfo}>
<strong>Contract:</strong> RegistryModuleOwnerCustom
<NetworkAddress type="registryModule" chain={chain} />
</div>
</li>
<li>The RegistryModuleOwnerCustom will be displayed in the "Deployed Contracts" section</li>
<li>Click on the RegistryModuleOwnerCustom contract address to open the contract details</li>
<li>
Call <code>registerAdminViaOwner</code>:
<div className={styles.functionCall}>
<div className={styles.functionHeader}>
<code className={styles.functionName}>registerAdminViaOwner</code>
<div className={styles.functionPurpose}>
Register yourself as the CCIP administrator for your token
</div>
</div>

<div className={styles.functionRequirement}>⚠️ You must be the token owner to call this function</div>

<div className={styles.parametersSection}>
<div className={styles.parametersTitle}>Parameters:</div>
<div className={styles.parametersList}>
<SolidityParam
name="token"
type="address"
description="The token contract you want to administer"
example={tokenAddress || "Your deployed token address"}
/>
</div>
</div>
</div>
</li>
<li>Confirm the transaction in MetaMask</li>
</ol>
</TutorialStep>

<TutorialStep
id={getSubStepId("admin-accepted")}
title="Accept Admin Role"
checkbox={<StepCheckbox stepId={stepId} subStepId="admin-accepted" />}
>
<ol className={styles.instructions}>
<li>
In the "Deploy & Run Transactions" tab, select <strong>TokenAdminRegistry</strong> contract
</li>
<li>
Click "At Address" with:
<div className={styles.contractInfo}>
<strong>Contract:</strong> TokenAdminRegistry
<NetworkAddress type="tokenAdminRegistry" chain={chain} />
</div>
</li>
<li>The TokenAdminRegistry will be displayed in the "Deployed Contracts" section</li>
<li>Click on the TokenAdminRegistry contract address to open the contract details</li>
<li>
Call <code>acceptAdminRole</code>:
<div className={styles.functionCall}>
<div className={styles.functionHeader}>
<code className={styles.functionName}>acceptAdminRole</code>
<div className={styles.functionPurpose}>Accept your role as CCIP administrator for your token</div>
</div>

<div className={styles.functionRequirement}>
⚠️ Must be called after registerAdminViaOwner is confirmed
</div>

<div className={styles.parametersSection}>
<div className={styles.parametersTitle}>Parameters:</div>
<div className={styles.parametersList}>
<SolidityParam
name="token"
type="address"
description="The token contract to accept administrator role for"
example={tokenAddress || "Your deployed token address"}
/>
</div>
</div>
</div>
</li>
<li>Confirm the transaction in MetaMask</li>
</ol>
</TutorialStep>
</ol>
</>
)

return (
<TutorialCard
title="Claim and Accept Admin Role"
description="Configure your EOA as CCIP administrator of your token"
>
{content}
</TutorialCard>
)
}
Loading
Loading