Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,5 @@ dist

# Finder (MacOS) folder config
.DS_Store

yarn.lock
3 changes: 2 additions & 1 deletion frontend/app/infoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const InfoModal: FC<ModalProps> = ({ isOpen, setIsOpen }) => {
<AlertDialogHeader>
<AlertDialogTitle>Your private key will not be saved!</AlertDialogTitle>
<AlertDialogDescription className="text-justify">
The private key will not leave your computer. It is only used to sign a transaction locally in this website. And is never sent to our servers or transmited over the internet
The private key will not leave your computer. It is only used to sign a transaction locally in this website.
And is never sent to our servers or transmited over the internet
<br />
Please double check that this is the correct URL and that you are not being phished.
</AlertDialogDescription>
Expand Down
4 changes: 1 addition & 3 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export default function Home() {
<main className="flex flex-col items-center justify-center">
<div className="flex items-center justify-center p-5 ">
<div className="flex flex-col m-24 max-w-5xl">
<h5 className="text-2xl text-gray-950 text-center font-barlow">
Upgrade your deprecated account
</h5>
<h5 className="text-2xl text-gray-950 text-center font-barlow">Upgrade your deprecated account</h5>
<h4 className="text-1xl text-gray-950 text-center py-2 mb-5">
⚠️ This is a rare exception that we provide a tool that asks for your private key. As an alternative you can
upgrade with our command-line tool or run this webapp locally. Everything is available{" "}
Expand Down
53 changes: 53 additions & 0 deletions scripts/deployment-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { CallData, hash, num, transaction } from "starknet";
import {
udcContractAddress,
v0_2_0_implementationClassHash,
v0_2_0_proxyClassHash,
v0_2_1_implementationClassHash,
v0_2_2_implementationClassHash,
v0_2_2_proxyClassHash,
v0_2_3_0_implementationClassHash,
v0_2_3_1_implementationClassHash,
} from "../frontend/services";

// Put here the account's public key
const owner = BigInt("0x1");
const contractAddressToFind = BigInt("0x1");

const proxies = [v0_2_2_proxyClassHash, v0_2_0_proxyClassHash];

const oldArgentAccountClassHashes = [
v0_2_0_implementationClassHash,
v0_2_1_implementationClassHash,
v0_2_2_implementationClassHash,
v0_2_3_0_implementationClassHash,
v0_2_3_1_implementationClassHash,
];

for (const proxyClassHash of proxies) {
for (const oldArgentAccountClassHash of oldArgentAccountClassHashes) {
const constructorCalldata = CallData.compile({
implementation: oldArgentAccountClassHash,
selector: hash.getSelectorFromName("initialize"),
calldata: CallData.compile({ owner, guardian: 0 }),
});

const contractAddress = hash.calculateContractAddressFromHash(owner, proxyClassHash, constructorCalldata, 0);
if (BigInt(contractAddress) === contractAddressToFind) {
const { calls } = transaction.buildUDCCall(
{
classHash: proxyClassHash,
salt: num.toHex(owner),
constructorCalldata,
unique: false,
},
udcContractAddress,
);
console.log("Open the UDC at https://voyager.online/contract/" + udcContractAddress + "#writeContract");
console.log("deploy_contract_calldata: \n", calls[0].calldata.join(", "));
process.exit(0);
}
}
}

console.log("Contract not found");
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "Node",
"lib": ["es2020", "dom"],
"lib": ["es2020", "dom"]
},
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node",
"experimentalSpecifierResolution": "node"
},
"include": ["/**/*.ts"],
"exclude": ["node_modules", "cairo"],
"exclude": ["node_modules", "cairo"]
}