Skip to content

Commit 881400d

Browse files
aelmanaakhadnithedriftofwords
authored
Ccip/1.5.1 remix (#2205)
* update * update * update * update * update * update * update * update * token pool upgradability * cct token decimals * cct - OZ Access control * update tasks * cct hardhat guides update 1 * EOA Foundry * update * update * changelog * changelog * update * Foundry Pool Rate Limites guide * update * rollback OZ change * update * Apply suggestions from code review Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * update * Foundry - maxSupply fix * update * update * update * update * update * update * update * update * update * update * update * Ccip/1.5.1 remix 2 (#2213) * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * fix store * fix store * fix update * fix update * fix update * fix update * navigation * update urls * update * update * update * update * update * verification * callout * callout * verify rate * verify rate * verify rate * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * Update src/components/CCIP/TutorialBlockchainSelector/AdminSetupStep.tsx Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * Update src/content/ccip/tutorials/cross-chain-tokens/register-from-eoa-remix.mdx Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com> * update * update --------- Co-authored-by: Karim <98668332+khadni@users.noreply.github.com> Co-authored-by: Crystal Gomes <thedriftofwords@users.noreply.github.com>
1 parent 13581ca commit 881400d

File tree

76 files changed

+8948
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+8948
-12
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
dist
22
.cache
33
.test
4+
.vercel
5+
.astro
6+
temp
47
node_modules
58
.github
69
.changeset

public/samples/CCIP/cct/TokenDependencies.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ pragma solidity 0.8.24;
33

44
// solhint-disable no-unused-import
55
import {BurnMintERC677} from "@chainlink/contracts-ccip/src/v0.8/shared/token/ERC677/BurnMintERC677.sol";
6+
import {BurnMintTokenPool} from "@chainlink/contracts-ccip/src/v0.8/ccip/pools/BurnMintTokenPool.sol";
7+
import {LockReleaseTokenPool} from "@chainlink/contracts-ccip/src/v0.8/ccip/pools/LockReleaseTokenPool.sol";
8+
import {RegistryModuleOwnerCustom} from "@chainlink/contracts-ccip/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol";
9+
import {TokenAdminRegistry} from "@chainlink/contracts-ccip/src/v0.8/ccip/tokenAdminRegistry/TokenAdminRegistry.sol";
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
.steps {
2+
padding-left: var(--space-4x);
3+
margin: 0;
4+
display: flex;
5+
flex-direction: column;
6+
gap: var(--space-4x);
7+
}
8+
9+
.instructions {
10+
padding-left: var(--space-6x);
11+
margin: 0;
12+
display: flex;
13+
flex-direction: column;
14+
gap: var(--space-3x);
15+
}
16+
17+
.contractInfo {
18+
display: flex;
19+
align-items: center;
20+
gap: var(--space-3x);
21+
padding: var(--space-3x);
22+
background: var(--color-background-secondary);
23+
border: 1px solid var(--color-border);
24+
border-radius: var(--border-radius);
25+
margin-bottom: var(--space-3x);
26+
}
27+
28+
.contractInfo strong {
29+
color: var(--color-text-primary);
30+
font-weight: 600;
31+
}
32+
33+
.actionDetails {
34+
display: flex;
35+
flex-direction: column;
36+
gap: var(--space-2x);
37+
}
38+
39+
.actionTitle {
40+
font-weight: 500;
41+
color: var(--color-text-primary);
42+
}
43+
44+
.actionTitle code {
45+
font-family: var(--font-mono);
46+
color: var(--color-text-primary);
47+
background: var(--color-background);
48+
padding: var(--space-1x) var(--space-2x);
49+
border-radius: 4px;
50+
font-size: var(--font-size-sm);
51+
}
52+
53+
.parameter {
54+
display: grid;
55+
grid-template-columns: 120px 1fr;
56+
gap: var(--space-3x);
57+
align-items: center;
58+
padding: var(--space-2x) var(--space-3x);
59+
background: var(--color-background-secondary);
60+
border: 1px solid var(--color-border);
61+
border-radius: var(--border-radius);
62+
}
63+
64+
.paramName {
65+
font-family: var(--font-mono);
66+
font-size: var(--font-size-sm);
67+
color: var(--color-text-secondary);
68+
}
69+
70+
/* Responsive adjustments */
71+
@media (max-width: 768px) {
72+
.parameter {
73+
grid-template-columns: 1fr;
74+
gap: var(--space-2x);
75+
}
76+
}
77+
78+
.functionDescription {
79+
color: var(--color-text-secondary);
80+
font-size: var(--font-size-sm);
81+
margin: var(--space-2x) 0;
82+
}
83+
84+
.parameters {
85+
margin-top: var(--space-2x);
86+
}
87+
88+
.functionCall {
89+
background: var(--color-background-secondary);
90+
border: 1px solid var(--color-border);
91+
border-radius: var(--border-radius);
92+
padding: var(--space-4x);
93+
margin: var(--space-2x) 0;
94+
}
95+
96+
.functionHeader {
97+
margin-bottom: var(--space-3x);
98+
}
99+
100+
.functionName {
101+
font-family: var(--font-mono);
102+
font-size: var(--font-size-lg);
103+
color: var(--color-text-primary);
104+
background: var(--color-background);
105+
padding: var(--space-1x) var(--space-2x);
106+
border-radius: 4px;
107+
}
108+
109+
.functionPurpose {
110+
color: var(--color-text);
111+
margin-top: var(--space-2x);
112+
font-size: var(--font-size-base);
113+
}
114+
115+
.functionRequirement {
116+
color: var(--color-warning);
117+
font-size: var(--font-size-sm);
118+
margin-bottom: var(--space-3x);
119+
}
120+
121+
.parametersSection {
122+
border-top: 1px solid var(--color-border);
123+
padding-top: var(--space-3x);
124+
}
125+
126+
.parametersTitle {
127+
font-weight: 600;
128+
color: var(--color-text-primary);
129+
margin-bottom: var(--space-2x);
130+
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
import { useStore } from "@nanostores/react"
2+
import { laneStore } from "@stores/lanes"
3+
import { NetworkCheck } from "../TutorialSetup/NetworkCheck"
4+
import { TutorialCard } from "../TutorialSetup/TutorialCard"
5+
import { TutorialStep } from "../TutorialSetup/TutorialStep"
6+
import { NetworkAddress } from "./NetworkAddress"
7+
import { StepCheckbox } from "../TutorialProgress/StepCheckbox"
8+
import { SolidityParam } from "../TutorialSetup/SolidityParam"
9+
import { Callout } from "../TutorialSetup/Callout"
10+
import styles from "./AdminSetupStep.module.css"
11+
12+
interface AdminSetupStepProps {
13+
chain: "source" | "destination"
14+
}
15+
16+
export const AdminSetupStep = ({ chain }: AdminSetupStepProps) => {
17+
const state = useStore(laneStore)
18+
const network = chain === "source" ? state.sourceNetwork : state.destinationNetwork
19+
const networkInfo = network ? { name: network.name, logo: network.logo } : { name: "loading..." }
20+
const stepId = chain === "source" ? "sourceChain" : "destinationChain"
21+
const tokenAddress = chain === "source" ? state.sourceContracts.token : state.destinationContracts.token
22+
23+
const getSubStepId = (subStepId: string) => `${stepId}-${subStepId}`
24+
25+
const content = (
26+
<>
27+
<NetworkCheck network={networkInfo} />
28+
29+
<ol className={styles.steps}>
30+
<TutorialStep
31+
id={getSubStepId("admin-claimed")}
32+
title="Register as Admin"
33+
checkbox={<StepCheckbox stepId={stepId} subStepId="admin-claimed" />}
34+
>
35+
<Callout type="note" title="Admin Registration Options">
36+
The Cross-Chain Token (CCT) standard supports multiple methods for registering as a token administrator. We
37+
use <code>registerAdminViaOwner()</code> in this tutorial because our deployed BurnMintERC677 token
38+
implements the <code>owner()</code> function. For other token implementations, you might use different
39+
registration methods. See the{" "}
40+
<a href="/ccip/concepts/cross-chain-tokens#self-service-registration-flow">
41+
self-service registration documentation
42+
</a>{" "}
43+
for all available options.
44+
</Callout>
45+
46+
<ol className={styles.instructions}>
47+
<li>
48+
In the "Deploy & Run Transactions" tab, select the <strong>RegistryModuleOwnerCustom</strong> contract
49+
</li>
50+
<li>
51+
Click "At Address" with:
52+
<div className={styles.contractInfo}>
53+
<strong>Contract:</strong> RegistryModuleOwnerCustom
54+
<NetworkAddress type="registryModule" chain={chain} />
55+
</div>
56+
</li>
57+
<li>The RegistryModuleOwnerCustom will be displayed in the "Deployed Contracts" section</li>
58+
<li>Click on the RegistryModuleOwnerCustom contract address to open the contract details</li>
59+
<li>
60+
Call <code>registerAdminViaOwner</code>:
61+
<div className={styles.functionCall}>
62+
<div className={styles.functionHeader}>
63+
<code className={styles.functionName}>registerAdminViaOwner</code>
64+
<div className={styles.functionPurpose}>
65+
Register yourself as the CCIP administrator for your token
66+
</div>
67+
</div>
68+
69+
<div className={styles.functionRequirement}>⚠️ You must be the token owner to call this function</div>
70+
71+
<div className={styles.parametersSection}>
72+
<div className={styles.parametersTitle}>Parameters:</div>
73+
<div className={styles.parametersList}>
74+
<SolidityParam
75+
name="token"
76+
type="address"
77+
description="The token contract you want to administer"
78+
example={tokenAddress || "Your deployed token address"}
79+
/>
80+
</div>
81+
</div>
82+
</div>
83+
</li>
84+
<li>Confirm the transaction in MetaMask</li>
85+
</ol>
86+
</TutorialStep>
87+
88+
<TutorialStep
89+
id={getSubStepId("admin-accepted")}
90+
title="Accept Admin Role"
91+
checkbox={<StepCheckbox stepId={stepId} subStepId="admin-accepted" />}
92+
>
93+
<ol className={styles.instructions}>
94+
<li>
95+
In the "Deploy & Run Transactions" tab, select <strong>TokenAdminRegistry</strong> contract
96+
</li>
97+
<li>
98+
Click "At Address" with:
99+
<div className={styles.contractInfo}>
100+
<strong>Contract:</strong> TokenAdminRegistry
101+
<NetworkAddress type="tokenAdminRegistry" chain={chain} />
102+
</div>
103+
</li>
104+
<li>The TokenAdminRegistry will be displayed in the "Deployed Contracts" section</li>
105+
<li>Click on the TokenAdminRegistry contract address to open the contract details</li>
106+
<li>
107+
Call <code>acceptAdminRole</code>:
108+
<div className={styles.functionCall}>
109+
<div className={styles.functionHeader}>
110+
<code className={styles.functionName}>acceptAdminRole</code>
111+
<div className={styles.functionPurpose}>Accept your role as CCIP administrator for your token</div>
112+
</div>
113+
114+
<div className={styles.functionRequirement}>
115+
⚠️ Must be called after registerAdminViaOwner is confirmed
116+
</div>
117+
118+
<div className={styles.parametersSection}>
119+
<div className={styles.parametersTitle}>Parameters:</div>
120+
<div className={styles.parametersList}>
121+
<SolidityParam
122+
name="token"
123+
type="address"
124+
description="The token contract to accept administrator role for"
125+
example={tokenAddress || "Your deployed token address"}
126+
/>
127+
</div>
128+
</div>
129+
</div>
130+
</li>
131+
<li>Confirm the transaction in MetaMask</li>
132+
</ol>
133+
</TutorialStep>
134+
</ol>
135+
</>
136+
)
137+
138+
return (
139+
<TutorialCard
140+
title="Claim and Accept Admin Role"
141+
description="Configure your EOA as CCIP administrator of your token"
142+
>
143+
{content}
144+
</TutorialCard>
145+
)
146+
}

0 commit comments

Comments
 (0)