Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda