From 869886dd29c4b9b56c32f38a696ba5b67692d063 Mon Sep 17 00:00:00 2001 From: Paul Fears Date: Thu, 7 Nov 2024 12:11:18 -0600 Subject: [PATCH] clean up removed console.logs compled audit highlights --- .../auditHighlights/KYR-01-006_highlights.txt | Bin 0 -> 8686 bytes .../Cure53 Audit 1/auditHighlights/readme.md | 4 ++-- snap/Auth.ts | 17 +------------- snap/TransactionAnalizer.ts | 1 - snap/Wallet.ts | 22 +++++++----------- snap/WalletFuncs.ts | 8 ++----- snap/federation.ts | 2 -- snap/index.tsx | 7 ++---- snap/screens.ts | 2 -- 9 files changed, 15 insertions(+), 48 deletions(-) create mode 100644 audits/Cure53 Audit 1/auditHighlights/KYR-01-006_highlights.txt diff --git a/audits/Cure53 Audit 1/auditHighlights/KYR-01-006_highlights.txt b/audits/Cure53 Audit 1/auditHighlights/KYR-01-006_highlights.txt new file mode 100644 index 0000000000000000000000000000000000000000..236a82b255bab2e0ea45227b9d730e625cb69759 GIT binary patch literal 8686 zcmc(lYi|=r6o%((EA>CDKrKNb7blJr(?UsURS=>e0;;NhsO*iM2J9rY9Uwyd^|tSG zj)&RxZk$l!qE+nO*}0tSdoIpDfA5FG(ASlP6A#SDD=Ws z*wp*o5AU+jD9wGK6$jzZFqnS(>PO+X@J#!!Yc`+jp&9o*|JiqUzsmR%>KFHA$rf$QphseB^R@$>G5 zdpd1J=y^-hKnBZpzbWL%^p3Yb%9=o8dTMnE%m>gc50cE*d3gx;B*#3!pcYpe_F%EEPBS@>D=JK7Go%+=se6>Q-fdgrXKc z?u5+rwGtkSno)Qqy3hC`&;LiG%jSFK zOb!p|Nay(DqBI-rc3=K@qAQc8h__^>SnrXZ(HmAc)_c(GtYn{irgK)l2oI-TP?e@< zZ0?8k@{W4mm7eg^tF)`jNOuwT6{TC1N9#iSBT}LDtJKV8=Y+Wd?)>K}( zArI)fC(8w4h^fS~zMjbLv1cM8Xxpzn15jANR((Se8y+#JLIe7JH6oj^ubqmuTEkCekrmr+PY(v^`TSR!POI z@1oo%=1;_VG#Q^gpYp86;|AJ|F=WYTiJ3N56YC_hhN|D(EMdkI%_c7%Y3?r;jX;mv zGgdxt78aNGa4N~W9fi;d*6S7tXY?H0LnEb8F7WGFG5k%;GkisyL42fgKnt-7bbpAt zFXrGex-Y`&+;90LmJURBrq4rJ1ia2x5YX@5>6~~Cj}ur2Znt47ED-C?1EO zB%xi^4ZDh0kERl1r*aiZJ$E2Z;%T#1oTxn(RY}8ja(AiCR*PUTG=F+`GFtir?N-ic z$Kvn5_8Tv=D?Gp*K1x@RjD>z7_S(_ebOrm05kwwxlWK3|{2t-Q_Gm9dZ?dwF?J{0& z_oz>FJzu}k8`cW)Lsw&yBh<~CF)MdsGg;!gHi}A?y8o7J^f;=uhsn|`r zh^o{HYO5F2*2#2&xF>6ky&$ZG=r|I`u|{-XXtCE9X)1Ocdto>i5E5!XWTrqA2LJ)V;fyqIX&i z&#~IOrDrfR?VpAB6}su;(J^1E!E{G#_^!+0o3;{JTvbhjOvyOkPUQ$?Xe;LOpucy9 z%F9aYQCs zlJs||1?UcqrDsQRG!l_Lw>!^L7^O<)JUAgvrkGNWJVb9|65S?`h2BN3H)(3%dY`xg>qC-)1N zHoIYM)tZosZ>dz}CCcKyNV2Zqlq|=k=haG@UG7a4CF;H!d5jfgT1j6k`ae~s=f-=I z8uCRKM8QPqo@DG*>iu(Q1v?^A#B*I^>>y?|HMXUQjn3!&o-v;u&Z>_d=TR2p zM?;y!j-m$VFN*?yf|B!Mh*tv0psf2@FNqpOb`v4{NP5Api+X#ZH~b!o<)DkyiF;~# z`Hzc!q%fBIO!ulPhyPD{ @@ -56,13 +54,6 @@ export class Auth{ const pk = this.keypair.rawPublicKey().toString('hex'); const addr = this.keypair.publicKey(); const proof = await this.signData(testKey); - console.log("auth object -----------------------------") - console.log('pk') - console.log(pk); - console.log('addr'); - console.log(addr); - console.log('proof'); - console.log(proof); return { pk, addr, @@ -89,11 +80,7 @@ export class Auth{ const auth = await this.getAuthObject(testKey); console.log("sign on post"); jsonData.auth = auth; - console.log("auth is"); - console.log(jsonData.auth); const outAuth = JSON.stringify(jsonData); - console.log("out auth is"); - console.log(outAuth) const response = await fetch(url, { method:'POST', @@ -103,11 +90,9 @@ export class Auth{ body: outAuth } ) - console.log(response); const output = await response.json(); - console.log("json output is"); - console.log(output); + return output; } } \ No newline at end of file diff --git a/snap/TransactionAnalizer.ts b/snap/TransactionAnalizer.ts index 9b34439..8d9e54e 100644 --- a/snap/TransactionAnalizer.ts +++ b/snap/TransactionAnalizer.ts @@ -64,7 +64,6 @@ async function getAddressInfo(addresses:string[]){ } const response = await fetch(url+query); const output = await response.json(); - console.log(output); return output._embedded.records; } diff --git a/snap/Wallet.ts b/snap/Wallet.ts index 0deac1f..e8db46e 100644 --- a/snap/Wallet.ts +++ b/snap/Wallet.ts @@ -28,14 +28,12 @@ export class Wallet{ //this.keyPair = nacl.sign.keyPair.fromSeed(seed); console.log("seeding"); const seed = account.seed; - console.log(seed); let bufferSeed = new Uint8Array(32); for(let i = 0; i<32; i++){ bufferSeed[i] = seed[i]; } console.log("about to make keyPair"); this.keyPair = Keypair.fromRawEd25519Seed(bufferSeed as Buffer); - console.log(this.keyPair); //this.address = StrKey.encodeEd25519PublicKey(this.keyPair.publicKey.buffer); this.address = this.keyPair.publicKey(); //this.publicKey = this.keyPair.publicKey @@ -101,7 +99,7 @@ export class Wallet{ else{ salt = "salt "+String(numAccounts+1) } - console.log("salt is: "+salt); + let tempAccount = await Wallet.getTempAccountFromSalt(salt); tempAccount.name = name; @@ -143,11 +141,10 @@ export class Wallet{ setState = true; } let currentState = await StateManager.getState(); - console.log("got current state"); - console.log(currentState); + let walletAccount:walletAccount; if(currentState.currentAccount === null){ - console.log("current State is null"); + let success = await Wallet.createNewAccount('Account 1', currentState, setState); if(!success){ @@ -208,8 +205,7 @@ export class Wallet{ const seed = await this.getSeedFromSalt(salt); let keyPair = Keypair.fromRawEd25519Seed(seed as Buffer); //this.address = StrKey.encodeEd25519PublicKey(this.keyPair.publicKey.buffer); - console.log("seed is"); - console.log(seed); + const address = keyPair.publicKey(); const account:walletAccount = { address:address, @@ -273,20 +269,18 @@ export class Wallet{ if(currentState === undefined){ console.log("currentState is undefined") currentState = await StateManager.getState(); - console.log(currentState); + } - console.log(currentState.accounts); + let output:Array<{"name":string, "address":string}> = [] - console.log(currentState.accounts); + for(let account of Object.values(currentState.accounts)){ - console.log(account); + output.push({ name:account.name, address:account.address }) } - console.log("output is"); - console.log(output); return output; } diff --git a/snap/WalletFuncs.ts b/snap/WalletFuncs.ts index 35f32c7..f30b4b8 100644 --- a/snap/WalletFuncs.ts +++ b/snap/WalletFuncs.ts @@ -99,9 +99,6 @@ export class WalletFuncs{ throw new Error("user rejected request"); } txn.sign(this.keyPair); - console.log(txn); - console.log("xdr is: "); - console.log(txn.toEnvelope().toXDR()); return txn; } @@ -109,11 +106,10 @@ export class WalletFuncs{ if(confirmation === undefined){ confirmation = true; } - console.log("inHere") + const signedTxn = await this.signArbitaryTxn(xdrTransaction, confirmation); - console.log("next"); const response = await this.client.submitTransaction(signedTxn); - console.log("response got"); + console.log("submited transaction response is"); console.log(response); if(response.successful){ await Utils.notify("Transaction Successful") diff --git a/snap/federation.ts b/snap/federation.ts index fb04843..e9efeab 100644 --- a/snap/federation.ts +++ b/snap/federation.ts @@ -112,8 +112,6 @@ export async function lookupAddress(address:string):Promise{ return {'error':"not found", 'stellar_address':null, 'account_id':null} } const output = await res.json(); - console.log("output text is:"); - console.log(output); return output; } catch(e){ diff --git a/snap/index.tsx b/snap/index.tsx index 0ab5ec0..b0dfc00 100644 --- a/snap/index.tsx +++ b/snap/index.tsx @@ -222,7 +222,7 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ origin, request }) => * */ let dataPacket = await getDataPacket(wallet, client); - console.log(operations); + let interfaceId = await sendXLM(dataPacket, wallet, operations, testnet); let result = await Utils.openDialog(interfaceId); @@ -246,10 +246,7 @@ export const onHomePage: OnHomePageHandler = async () => { export const onUserInput: OnUserInputHandler = async ({id, event}) => { - console.log(id); - console.log(event); - console.log("interacton table is: "); - console.log(InteractionHandler.interactionTable); + if(event.name){ diff --git a/snap/screens.ts b/snap/screens.ts index ec43526..1f1823c 100644 --- a/snap/screens.ts +++ b/snap/screens.ts @@ -46,8 +46,6 @@ export class Screens{ text("Enter a name for account:"), copyable(address), ]); - console.log("disp is"); - console.log(disp); return await Utils.displayPanel(disp, "prompt") }