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

Add fontawesome script to index.html, create getAccount.js file, upda… #27

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

mmpotulo28
Copy link
Member

…te truffle-config.js for celo network, and update dependencies in package.json

…te truffle-config.js for celo network, and update dependencies in package.json
@mmpotulo28 mmpotulo28 merged commit cd6eef1 into main Apr 21, 2024
3 checks passed
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mmpotulo28 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Docstrings: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +1 to +18
// get cell account and pprivatekey
// return account and privatekey
// account: string
// privatekey: string
// return: {account: string, privatekey: string}
const Web3 = require('web3');
const web3 = new Web3(
new Web3.providers.HttpProvider('http://alfajores-forno.celo-testnet.org'),
);

function getAccount() {
let account = '0x' + web3.eth.accounts.create().address;
let privatekey = web3.eth.accounts.create().privateKey;
let mnemonic = web3.eth.accounts.create().mnemonic;
return { account: account, privatekey: privatekey, mnemonic: mnemonic };
}

console.log(getAccount());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Review the security implications of generating keys in client-side code.

Generating keys on the client-side can expose sensitive information. Consider server-side generation and secure transmission methods.

function getAccount() {
let account = '0x' + web3.eth.accounts.create().address;
let privatekey = web3.eth.accounts.create().privateKey;
let mnemonic = web3.eth.accounts.create().mnemonic;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Prefer object destructuring when accessing and using properties. (use-object-destructuring)

Suggested change
let mnemonic = web3.eth.accounts.create().mnemonic;
let {mnemonic} = web3.eth.accounts.create();


ExplanationObject destructuring can often remove an unnecessary temporary reference, as well as making your code more succinct.

From the Airbnb Javascript Style Guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant