Skip to content

Commit

Permalink
Merge pull request #670 from OpenZeppelin/642-change-testnet-recommen…
Browse files Browse the repository at this point in the history
…dation-to-sepolia

Switch recommended network to Sepolia
  • Loading branch information
xaler5 authored Jun 29, 2023
2 parents 493fc93 + 85713cd commit c4bfefe
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ In order to install, build, and run Ethernaut locally, follow these instructions
yarn start:ethernaut
```

### Running locally (goerli network)
### Running locally (sepolia network)

The same as using the local network but steps 2, 3 and 6 are not necessary.

In this case, replace point 5 with:
5. Set `client/src/constants.js` `ACTIVE_NETWORK` to `NETWORKS.GOERLI`
5. Set `client/src/constants.js` `ACTIVE_NETWORK` to `NETWORKS.SEPOLIA`

### Running tests

Expand All @@ -79,7 +79,7 @@ yarn build:ethernaut

You will normally need to deploy it on a local network, for this you can just run `yarn deploy:contracts` and all the contracts will be deployed on your local node running on `localhost:8545` and you will be able to check each level address in the `deploy.local.json` file.

To deploy the contracts on Goerli, first set the `ACTIVE_NETWORK` variable in `constants.js` and then edit `deploy.goerli.json`. This file keeps a history of all level and contract instances. To deploy a new instance, add an "x" entry to the array, like so:
To deploy the contracts on Sepolia, first set the `ACTIVE_NETWORK` variable in `constants.js` and then edit `deploy.sepolia.json`. This file keeps a history of all level and contract instances. To deploy a new instance, add an "x" entry to the array, like so:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion client/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const SHOW_VERSION = true;
// export const ACTIVE_NETWORK = NETWORKS.MUMBAI
// export const ACTIVE_NETWORK = NETWORKS.OPTIMISM_GOERLI
// export const ACTIVE_NETWORK = NETWORKS.ARBITRUM_GOERLI
export const ACTIVE_NETWORK = NETWORKS.LOCAL;
// export const ACTIVE_NETWORK = NETWORKS.LOCAL;

let id_to_network = {};
Object.keys(NETWORKS)
Expand Down
12 changes: 6 additions & 6 deletions client/src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class App extends React.Component {
(key) => key !== "LOCAL" && key !== "UNDEFINED"
);

// change the network to goreli network
async function switchToGoerli() {
// change the network to Sepolia network
async function switchToSepolia() {
let elements = document.querySelectorAll('.progress-bar-wrapper');
const deployWindow = document.querySelectorAll('.deploy-window-bg');
try {
await window.ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: `0x${Number(constants.NETWORKS.GOERLI.id).toString(16)}` }],//if on wrong network giving option to switch to sepolia network.
params: [{ chainId: `0x${Number(constants.NETWORKS.SEPOLIA.id).toString(16)}` }],//if on wrong network giving option to switch to sepolia network.
});
deployWindow[0].style.display = 'none';
} catch (switchError) {
Expand All @@ -70,7 +70,7 @@ class App extends React.Component {
method: 'wallet_addEthereumChain',
params: [
{
chainId: [{ chainId: `0x${Number(constants.NETWORKS.GOERLI.id).toString(16)}` }]
chainId: [{ chainId: `0x${Number(constants.NETWORKS.SEPOLIA.id).toString(16)}` }]
},
],
});
Expand Down Expand Up @@ -140,9 +140,9 @@ class App extends React.Component {
</button>
<button
className="buttons"
onClick={switchToGoerli}
onClick={switchToSepolia}
>
{strings.switchToGoerli}
{strings.switchToSepolia}
</button>
</div>
<p className="deploy-note">{strings.deployNote}</p>
Expand Down
6 changes: 3 additions & 3 deletions client/src/gamedata/ar/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"getNewInstance": "احصل على نسخة جديدة",
"deployMessageTitle": "لم يتم نشر اللعبة",
"deployMessage": "تدُعم اللُعبة حاليًا هذه الشبكات فقط:",
"deployConfirmation": "هل تريد نشر العقود على هذه الشبكة أم التبديل إلى شبكة Goerli؟",
"deployConfirmation": "هل تريد نشر العقود على هذه الشبكة أم التبديل إلى شبكة Sepolia",
"deployNote": "ملاحظة: إذا قمت بنشر جميع المستويات ، فسنرشدك إلى إرسال اللعبة المنشورة بالكامل على هذه الشبكة.",
"deployGame": "نشر اللعبة",
"switchToGoerli": "قم بالتبديل إلى Goerli",
"switchToSepolia": "قم بالتبديل إلى Sepolia",
"deployLevel": "نشر المستوى",
"helperDeployAllContracts": "نشر جميع العقود المتبقية على الشبكة الحالية.",
"confirmMainnetDeploy": "أنت على الشبكة الرئيسية ، اللعبة ليس لها قيمة نقدية ، يجب ألا تنشر في هذه الشبكة.",
Expand Down Expand Up @@ -100,7 +100,7 @@
"beyondConsole": "ستتطلب بعض المستويات العمل خارج وحدة تحكم المتصفح. أي كتابة كود سوليدتى ونشره في الشبكة لمهاجمة عقد نسخة المستوى بعقد آخر. يمكن القيام بذلك بعدة طرق ، على سبيل المثال: \n \n1) استخدم ريمكس لكتابة الكود ونشره في الشبكة المقابلة ، راجع [Remix Solidity IDE] (https://remix.ethereum.org/). \n \n2) قم بإعداد مشروع ترافل محلي لتطوير ونشر عقود الهجوم. راجع [إطار عمل ترافل] (http://truffleframework.com/).",
"troubleshooting": "في بعض الأحيان \n \n (أ) حالة التطبيق أو (ب) حالة البرنامج المساعد MetaMask \n \n يمكن أن تتعطل قليلاً ، خاصة بعد تبديل الشبكات ، وإلغاء القفل ، وما إلى ذلك. إذا لم يكن ما تراه منطقيًا ، حاول تحديث التطبيق ، وتحديثه بقوة ، وتعطيل البرنامج المساعد metamask وإعادة تمكينه أو حتى إعادة تشغيل المتصفح. \n \n إذا وجدت مشاكل ، فيرجى إخبارنا على [email protected]",
"poweredBy": "مُشَغل بواسطة ",
"setupMetamask": "إذا لم يكن لديك بالفعل ، فثبّت [ملحق متصفح ميتاماسك] (https://metamask.io/) (في Chrome أو Firefox أو Brave أو Opera على جهاز سطح المكتب). \n \n قم بإعداد محفظة الامتداد واستخدم محدد الشبكة للإشارة إلى الشبكة المفضلة في الجزء العلوي الأيسر من واجهة الامتداد. بدلاً من ذلك ، يمكنك استخدام زر واجهة المستخدم للتبديل بين الشبكات. إذا حددت شبكة غير مدعومة ، فستعلمك اللعبة وتنقلك إلى شبكة اختبار Goerli الافتراضية. \n \n بمجرد الانتهاء ، ارجع إلى هنا وأعد تحميل صفحة الويب",
"setupMetamask": "إذا لم يكن لديك بالفعل ، فثبّت [ملحق متصفح ميتاماسك] (https://metamask.io/) (في Chrome أو Firefox أو Brave أو Opera على جهاز سطح المكتب). \n \n قم بإعداد محفظة الامتداد واستخدم محدد الشبكة للإشارة إلى الشبكة المفضلة في الجزء العلوي الأيسر من واجهة الامتداد. بدلاً من ذلك ، يمكنك استخدام زر واجهة المستخدم للتبديل بين الشبكات. إذا حددت شبكة غير مدعومة ، فستعلمك اللعبة وتنقلك إلى شبكة اختبار Sepolia الافتراضية. \n \n بمجرد الانتهاء ، ارجع إلى هنا وأعد تحميل صفحة الويب",
"FifthyPercentMessage": "عمل رائع! لقد وصلت إلى منتصف الطريق في ايثرناوت وتحصل على مستوى جيد في تحطيم الأشياء. قد يكون العمل كباحث أمن في البلوكتشين في OpenZeppelin ممتعًا ... https://grnh.se/fdbf1c043us",
"SeventyFivePercentMessage": "75٪: عمل جيد يا هذا ... أنت في أعماق حفرة الأرانب الآن .... من يدري إلى أين سيأخذك ... https://grnh.se/d4a786e43us",
"NinetyPercentMessage": "90٪: لقد أوشكت على الانتهاء! فقط عدد قليل من التحديات المتبقية حتى تكمل ايثرناوت! هل فكرت في الحصول على وظيفة في أمن البلوكتشين؟ https://grnh.se/cfcca8c83us",
Expand Down
2 changes: 1 addition & 1 deletion client/src/gamedata/en/descriptions/levels/instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This level walks you through the very basics of how to play the game.
&nbsp;
#### 1. Set up MetaMask
If you don't have it already, install the [MetaMask browser extension](https://metamask.io/) (in Chrome, Firefox, Brave or Opera on your desktop machine).
Set up the extension's wallet and use the network selector to point to the preferred network in the top left of the extension's interface. Alternatively you can use the UI button to switch between networks. If you select an unsupported network, the game will notify you and bring you to the default Goerli testnet.
Set up the extension's wallet and use the network selector to point to the preferred network in the top left of the extension's interface. Alternatively you can use the UI button to switch between networks. If you select an unsupported network, the game will notify you and bring you to the default Sepolia testnet.

#### 2. Open the browser's console
Open your browser's console: `Tools > Developer Tools`.
Expand Down
6 changes: 3 additions & 3 deletions client/src/gamedata/en/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"getNewInstance": "Get new instance",
"deployMessageTitle": "Game not deployed",
"deployMessage": "Currently the game supports only these networks:",
"deployConfirmation": "Do you want to deploy the contracts on this network or switch to the Goerli network?",
"deployConfirmation": "Do you want to deploy the contracts on this network or switch to the Sepolia network?",
"deployNote": "Note: If you deploy all levels, we'll guide you to submit the whole deployed game on this network.",
"deployGame": "Deploy game",
"switchToGoerli": "Switch to Goerli",
"switchToSepolia": "Switch to Sepolia",
"deployLevel": "Deploy Level",
"helperDeployAllContracts": "Deploy all the remaining contracts on the current network.",
"confirmMainnetDeploy": "You are on a mainnet, the game has no monetary value, you should not deploy in this network.",
Expand Down Expand Up @@ -100,7 +100,7 @@
"beyondConsole": "Some levels will require working outside of the browser console. That is, writing solidity code and deploying it in the network to attack the level's instance contract with another contract. This can be done in multiple ways, for example: \n\n1) Use Remix to write the code and deploy it in the corresponding network See [Remix Solidity IDE](https://remix.ethereum.org/). \n\n2) Setup a local truffle project to develop and deploy the attack contracts. See [Truffle Framework](http://truffleframework.com/).",
"troubleshooting": "Sometimes \n\n(a) the app state or (b) the MetaMask plugin state \n\ncan become a bit messed up, specially after switching networks, unlocking, etc. If what you're seeing doesn't make much sense, try refreshing the app, hard-refreshing it, disabling and re-enabling your metamask plugin or even restarting your browser. \n\nIf you find issues, please let us know at [email protected]",
"poweredBy": "powered by ",
"setupMetamask": "If you don't have it already, install the [MetaMask browser extension](https://metamask.io/) (in Chrome, Firefox, Brave or Opera on your desktop machine). \n\nSet up the extension's wallet and use the network selector to point to the preferred network in the top left of the extension's interface. Alternatively you can use the UI button to switch between networks. If you select an unsupported network, the game will notify you and bring you to the default Goerli testnet. \n\nOnce done, come back here and reload the webpage",
"setupMetamask": "If you don't have it already, install the [MetaMask browser extension](https://metamask.io/) (in Chrome, Firefox, Brave or Opera on your desktop machine). \n\nSet up the extension's wallet and use the network selector to point to the preferred network in the top left of the extension's interface. Alternatively you can use the UI button to switch between networks. If you select an unsupported network, the game will notify you and bring you to the default Sepolia testnet. \n\nOnce done, come back here and reload the webpage",
"FifthyPercentMessage": "Awesome work! You’re halfway through Ethernaut and getting pretty good at breaking things. Working as a Blockchain Security Researcher at OpenZeppelin could be fun... https://grnh.se/fdbf1c043us",
"SeventyFivePercentMessage": "75%: Good work anon…you’re deep down the rabbit hole now....who knows where it will take you... https://grnh.se/d4a786e43us",
"NinetyPercentMessage": "90%: You’re almost there anon! Just a few more challenges left until you complete Ethernaut! Have you considered a career in Blockchain Security?https://grnh.se/cfcca8c83us",
Expand Down
2 changes: 1 addition & 1 deletion client/src/gamedata/es/descriptions/levels/instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Este nivel te guiará a través de los conceptos básicos de cómo jugar.

#### 1. Configurar MetaMask
Si aún no lo tienes, instala la [extensión del navegador MetaMask](https://metamask.io/).
Configura la billetera de la extensión y usa el selector de red para apuntar a tu red preferida en la parte superior izquierda de la interfaz de la extensión. De forma alternativa, puedes usar el botón en la interfaz de usuario para cambiar entre diferentes redes. Si seleccionas una red no soportada, el juego te notificarà y llevarà a la red de test por defecto de Goerli.
Configura la billetera de la extensión y usa el selector de red para apuntar a tu red preferida en la parte superior izquierda de la interfaz de la extensión. De forma alternativa, puedes usar el botón en la interfaz de usuario para cambiar entre diferentes redes. Si seleccionas una red no soportada, el juego te notificarà y llevarà a la red de test por defecto de Sepolia.

#### 2. Abre la consola del navegador
Abre la consola de tu navegador: `Herramientas > Herramientas de desarrollo`.
Expand Down
6 changes: 3 additions & 3 deletions client/src/gamedata/es/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"getNewInstance": "Nueva instancia",
"deployMessageTitle": "Juego no desplegado",
"deployMessage": "Actualmente, el juego solo es compatible con estas redes.:",
"deployConfirmation": "¿Quieres implementar los contratos en esta red o cambiar a la red Goerli?",
"deployConfirmation": "¿Quieres implementar los contratos en esta red o cambiar a la red Sepolia?",
"deployNote": "Nota: si implementa todos los niveles, lo guiaremos para que envíe todo el juego implementado en esta red.",
"deployGame": "Desplegar juego",
"switchToGoerli": "Cambiar a Goerli",
"switchToSepolia": "Cambiar a Sepolia",
"deployLevel": "Desplegar implementación",
"helperDeployAllContracts": "Implemente todos los contratos restantes en la red actual.",
"confirmMainnetDeploy": "Estás en una red principal, el juego no tiene valor monetario, no debes implementarlo en esta red.",
Expand Down Expand Up @@ -100,7 +100,7 @@
"beyondConsole": "Some levels will require working outside of the browser console. That is, writing solidity code and deploying it in the network to attack the level's instance contract with another contract. This can be done in multiple ways, for example: \n\n1) Use Remix to write the code and deploy it in the corresponding network See [Remix Solidity IDE](https://remix.ethereum.org/).\n\n 2) Setup a local truffle project to develop and deploy the attack contracts. See [Truffle Framework](http://truffleframework.com/).",
"troubleshooting": "Sometimes \n\n(a) the app state or (b) the MetaMask plugin state \n\ncan become a bit messed up, specially after switching networks, unlocking, etc. If what you're seeing doesn't make much sense, try refreshing the app, hard-refreshing it, disabling and re-enabling your metamask plugin or even restarting your browser. \n\nIf you find issues, please let us know at [email protected]",
"poweredBy": "powered by ",
"setupMetamask": "Si aún no lo tienes, instala la [extensión del navegador MetaMask](https://metamask.io/). \n\nConfigura la billetera de la extensión y usa el selector de red para apuntar a tu red preferida en la parte superior izquierda de la interfaz de la extensión. De forma alternativa, puedes usar el boton en la interfaz de usuario para cambiar entre diferentes redes. Si seleccionas una red no soportada, el juego te notificarà y llevarà a la red de test por defecto de Goerli. \n\nUna vez hecho, vuelve aqui y vuelve a carga la pagin",
"setupMetamask": "Si aún no lo tienes, instala la [extensión del navegador MetaMask](https://metamask.io/). \n\nConfigura la billetera de la extensión y usa el selector de red para apuntar a tu red preferida en la parte superior izquierda de la interfaz de la extensión. De forma alternativa, puedes usar el boton en la interfaz de usuario para cambiar entre diferentes redes. Si seleccionas una red no soportada, el juego te notificarà y llevarà a la red de test por defecto de Sepolia. \n\nUna vez hecho, vuelve aqui y vuelve a carga la pagin",
"FifthyPercentMessage": "Awesome work! You’re halfway through Ethernaut and getting pretty good at breaking things. Working as a Blockchain Security Researcher at OpenZeppelin could be fun... https://grnh.se/fdbf1c043us",
"SeventyFivePercentMessage": "75%: Good work anon…you’re deep down the rabbit hole now....who knows where it will take you... https://grnh.se/d4a786e43us",
"NinetyPercentMessage": "90%: You’re almost there anon! Just a few more challenges left until you complete Ethernaut! Have you considered a career in Blockchain Security?https://grnh.se/cfcca8c83us",
Expand Down
Loading

0 comments on commit c4bfefe

Please sign in to comment.