Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda