Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ccip/1.5.1 remix #2205

Merged
merged 63 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b89ab9f
update
aelmanaa Nov 29, 2024
d4a9eac
update
aelmanaa Nov 29, 2024
4cd0995
update
aelmanaa Nov 29, 2024
f2c0aad
update
aelmanaa Nov 29, 2024
b0459f8
update
aelmanaa Nov 30, 2024
6841be8
update
aelmanaa Nov 30, 2024
8acf848
update
aelmanaa Nov 30, 2024
0e0770b
update
aelmanaa Nov 30, 2024
af26904
token pool upgradability
aelmanaa Dec 2, 2024
910bacf
cct token decimals
aelmanaa Dec 2, 2024
2e3bbaa
cct - OZ Access control
aelmanaa Dec 2, 2024
87fde17
update tasks
aelmanaa Dec 2, 2024
4c0af20
cct hardhat guides update 1
aelmanaa Dec 2, 2024
ccf3529
EOA Foundry
khadni Dec 2, 2024
be0cbe6
update
aelmanaa Dec 3, 2024
319abd9
update
aelmanaa Dec 3, 2024
81b6055
changelog
aelmanaa Dec 3, 2024
6d1791e
changelog
aelmanaa Dec 3, 2024
b5bc28a
update
aelmanaa Dec 3, 2024
16771c7
Foundry Pool Rate Limites guide
khadni Dec 3, 2024
47ff278
update
aelmanaa Dec 3, 2024
5e9a539
rollback OZ change
aelmanaa Dec 3, 2024
958f766
update
aelmanaa Dec 4, 2024
441e12f
Apply suggestions from code review
aelmanaa Dec 4, 2024
e9d6283
update
aelmanaa Dec 4, 2024
2625c77
Foundry - maxSupply fix
khadni Dec 4, 2024
291fd1f
update
aelmanaa Dec 4, 2024
155be83
update
aelmanaa Dec 5, 2024
d064a82
update
aelmanaa Dec 5, 2024
4904bd7
update
aelmanaa Dec 5, 2024
f4cf30d
update
aelmanaa Dec 5, 2024
c4db1e0
update
aelmanaa Dec 5, 2024
1c33ff1
update
aelmanaa Dec 5, 2024
fd6ee17
update
aelmanaa Dec 5, 2024
689a882
update
aelmanaa Dec 5, 2024
ab19f2c
update
aelmanaa Dec 5, 2024
1b1d61c
update
aelmanaa Dec 5, 2024
55c8f91
update
aelmanaa Dec 6, 2024
d5c7799
Merge branch 'main' into ccip/1.5.1-remix
khadni Dec 10, 2024
1e507f8
Ccip/1.5.1 remix 2 (#2213)
aelmanaa Dec 11, 2024
6c25f30
Merge branch 'main' into ccip/1.5.1-remix
aelmanaa Dec 11, 2024
e3e1ab3
update
aelmanaa Dec 11, 2024
cde49ec
Merge branch 'main' into ccip/1.5.1-remix
aelmanaa Dec 11, 2024
7d243c3
Merge branch 'main' into ccip/1.5.1-remix
aelmanaa Dec 13, 2024
ecb1567
update
aelmanaa Dec 13, 2024
ec7f125
update
aelmanaa Dec 13, 2024
4301e7a
update
aelmanaa Dec 13, 2024
8b4ef02
update
aelmanaa Dec 13, 2024
d0fed7a
update
aelmanaa Dec 13, 2024
272c199
update
aelmanaa Dec 13, 2024
5b88132
update
aelmanaa Dec 13, 2024
593f9c5
update
aelmanaa Dec 13, 2024
7566855
update
aelmanaa Dec 13, 2024
96196be
update
aelmanaa Dec 13, 2024
a0b3638
update
aelmanaa Dec 13, 2024
3350f73
Update src/components/CCIP/TutorialBlockchainSelector/AdminSetupStep.tsx
aelmanaa Dec 13, 2024
50416ae
Update src/content/ccip/tutorials/cross-chain-tokens/register-from-eo…
aelmanaa Dec 13, 2024
d5a1665
Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx
aelmanaa Dec 13, 2024
2b3d848
Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx
aelmanaa Dec 13, 2024
4770423
Update src/components/CCIP/TutorialBlockchainSelector/SetPoolStep.tsx
aelmanaa Dec 13, 2024
a7cfaf1
Merge branch 'main' into ccip/1.5.1-remix
aelmanaa Dec 13, 2024
4af04a8
update
aelmanaa Dec 13, 2024
e436c95
update
aelmanaa Dec 13, 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
4 changes: 4 additions & 0 deletions public/samples/CCIP/cct/TokenDependencies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ pragma solidity 0.8.24;

// solhint-disable no-unused-import
import {BurnMintERC677} from "@chainlink/contracts-ccip/src/v0.8/shared/token/ERC677/BurnMintERC677.sol";
import {BurnMintTokenPool} from "@chainlink/contracts-ccip/src/v0.8/ccip/pools/BurnMintTokenPool.sol";
import {LockReleaseTokenPool} from "@chainlink/contracts-ccip/src/v0.8/ccip/pools/LockReleaseTokenPool.sol";
import {RegistryModuleOwnerCustom} from "@chainlink/contracts-ccip/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol";
import {TokenAdminRegistry} from "@chainlink/contracts-ccip/src/v0.8/ccip/tokenAdminRegistry/TokenAdminRegistry.sol";
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);
}
146 changes: 146 additions & 0 deletions src/components/CCIP/TutorialBlockchainSelector/AdminSetupStep.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
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 { Callout } from "../TutorialSetup/Callout"
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" />}
>
<Callout type="note" title="Admin Registration Options">
The Cross-Chain Token (CCT) standard supports multiple methods for registering as a token administrator. We
use <code>registerAdminViaOwner()</code> in this tutorial because our deployed BurnMintERC677 token
implements the <code>owner()</code> function. For other token implementations, you might use different
registration methods. See the{" "}
<a href="/ccip/concepts/cross-chain-tokens#self-service-registration-flow">
self-service registration documentation
</a>{" "}
for all available options.
</Callout>

<ol className={styles.instructions}>
<li>
In the "Deploy & Run Transactions" tab, select <strong>RegistryModuleOwnerCustom</strong> contract
aelmanaa marked this conversation as resolved.
Show resolved Hide resolved
</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