Could someone explain basic transferFrom functionality

It seems to me that the following ERC20 function does not check where the message comes from and allow anyone to transfer tokens between two addresses: function transferFrom (address _from, address _to, uint256 _value) public delegatable payable returns (bool) { if (frozen) return false; else if ( (addressFlags [_from] | addressFlags [_to]) & BLACK_LIST_FLAG ==…

Signing Ropsten transactions with

I am trying to sign transactions using the Web3 HDWalletProvider package and an infura API. I am using the following code: const Web3 = require(‘web3’); const Web3HDWalletProvider = require(“web3-hdwallet-provider”); const mnemonic = “12 words” var httpProvider = new Web3.providers.HttpProvider(‘https://ropsten.infura.io/v3/[API]’); var provider = new Web3HDWalletProvider(mnemonic, httpProvider); I get the error Uncaught ReferenceError: require is not defined…

Enabling truffle compile optimizer does not change the bytecode output

I am trying to deploy my contract by enabling the optimizer to see how much I can save from the gas costs. I am using truffle for the deployment. In truffle I enable the optimizer by the following setting in truffle-config.js: compilers: { solc: { version: ‘^0.5.0’, settings: { evmVersion: ‘byzantium’ // Default: “petersburg” },…