How does function getPastEvents works? It’s too quick

I’m trying to understand how .getPastEvents function works. When given block range to search is {fromBlock:0, toBlock: ‘latest’} it finds my events almost instantaneously. Shouldn’t filtering all 7M blocks (using Ropsten testnet) take more than a second? Code snippet if it’s of any use. myContract.getPastEvents(“EventName”, {fromBlock:0, toBlock: ‘latest’}).then( function(event) { event.forEach(element => { //doing some…

Simple, default, “hello world” smart contract for an auction? (winner wins, all the rest gets refunded)

I recently read an article: https://medium.com/@jimmysong/the-truth-about-smart-contracts-ae825271811f Because of a lot of centralized marketing from Ethereum, there’s a mistaken belief that Smart Contracts only exist in Ethereum. This is not true. Bitcoin has had, from the very beginning in 2009, a pretty extensive smart contract language called Script. If Bitcoin has smart contracts, I would like…

Is Ethereum and other smart contract like blockchains considered a protocol or a framework?

I’m not sure how to explain Ethereum or other smart contract systems like eos/tron/ardor/waves. Are these protocols or are they frameworks? How should it be classified? I want to explain to clients that I’m building on top of a protocol or a framework? My application doesn’t require any ETH, but only interactions with crypto addresses…

Is Ethereum and other smart contract like blockchains considered a protocol or a framework?

I’m not sure how to explain Ethereum or other smart contract systems like eos/tron/ardor/waves. Are these protocols or are they frameworks? How should it be classified? I want to explain to clients that I’m building on top of a protocol or a framework? My application doesn’t require any ETH, but only interactions with crypto addresses…

web3.js 0.20.7 & Metamask: contract.setProvider(web3.givenProvider) is not a function

I am interacting with a contract on the Rinkeby testnet using web3.js (version 0.20.7) with Metamask and the chrome console. I setup a contract object called mycontract for a given ABI and address. When I set the web3 provider for this contract using mycontract.setProvider(web3.givenProvider) I get an error saying that mycontract.setProvider is not a function.…

Cannot transfer ownership of ERC20 contract

My contract source code likes below: contract StandardToken { uint256 totalSupply; … } contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract MyToken is StandardToken,…