Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Solidity web3 JS fix byPass hack?

I have some doups about how control de msg.sender using web3.

For example I have this function in solidity: Where owner is the msg.sender used in costructor. for example is 0x9;

function NoPass() external view returns(string memory){
  require(msg.sender == owner, "NO ERES EL PROPIETARIO");
  return "HACKEADO";}

Then from JS I call this function like:

contract.methods.NoPass().call({from:"0x9"}).then(res=>{
     console.log(res);})

I can call this function and skip require because my call FROM i write the same account like owner. How Can i fix it? Because I save the account in a value then hacker can modifie this account value and skip requires.

Thanks, I'm new In Send functions wrks its just call functions but meh it is normal?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

call() functions reads blockchain state and does not change state of blockchain. send() creates transaction and can change blockchain state. Access control is usually implemented only in functions which can change blockchain state. Also it would be good to use OpenZeppelin Ownable.sol for access control.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!