Categories
Cryptocurrency Ethereum Mastering Development

JS “TypeError” – Simple UI script is giving an Uncaught error

I am doing the Lynda Ethereum course and am working on the UI with JS. This line of code: var ApprovalContract = new Web3.eth.Contract(abi,contractAddress); Gives this error: index.html:114 Uncaught TypeError: Cannot read property ‘Contract’ of undefined at index.html:114 Here is the full html: <!doctype html> <html lang=”en”> <head> <!– Required meta tags –> <meta charset=”utf-8″> […]

Categories
Cryptocurrency Ethereum Mastering Development

How to save/read mappings within struct?

I am trying to create a mapping inside struct and then create a mapping of the struct. Take a look at below example: // ———————————————————————— // Each Level related details are stored using `Level` struct // ———————————————————————— struct Level{ address payable luckyDraw; uint256 dividend; address payable topHolder; uint256 topInvestment; uint256 reversedAllowed; mapping(address => uint256) userReversed; […]

Categories
Cryptocurrency Ethereum Mastering Development

Cannot find module ‘@truffle/hdwallet-provider’

I am trying to deploy a smart contract that works nicely in Ganache to a test net (Kovan). However, all the tutorials out there use a package called hdwallet provider. When I follow the documentation and try to install it locally (then I tried globally) I keep getting this error: Error: Cannot find module ‘@truffle/hdwallet-provider’ […]

Categories
Cryptocurrency Ethereum Mastering Development

Problem with Syntax in Solidity with sale contract

Good evening. Well, I have really been battling with this and have followed instructions to the “T” but somehow i’m not getting the Syntax right on Solidity. I’m using Remix in my Web.3 Browser. I need a little help please if possible as to where I need to insert my wallet address, token info, value […]

Categories
Cryptocurrency Ethereum Mastering Development

How long does it take it typically take for call value of changed variable to update?

I’m trying to mine a proof of work contract. Each time a solution is found, the return value for units.functions.getChallengeNumber().call() should change. I ran two instances of this script (with different PUBLIC_KEYs) to see what would happen if multiple people were trying to solve a problem for the same contract. From what I see on […]

Categories
Cryptocurrency Ethereum Mastering Development

Etherscan and Token value

can you PLEASE tell me how to get my coin balances off of etherscan and on to say an exchange or on to metamask? I can not figure out how to do this it’s driving me crazy! the balances are there but I can not access them!! so frustrating. can you help me? it would […]

Categories
Cryptocurrency Ethereum Mastering Development

Target Rate Feedback Mechanism (TRFM) Not Easy to Understand

From this article, I read: When Dai below the target price the following happens: The Target Rate increases. This causes the Target Price to increase at a higher rate. This causes Dai generation via CDP to become more expensive. The increased target rate causes an increase in Dai demand. The combination of reduced supply and […]

Categories
Cryptocurrency Ethereum Mastering Development

Town Crier Relay

I’m reading the paper Town Crier: An Authenticated Data Feed for Smart Contracts and i’m failing to understand this bit The Relay is an ordinary user-space application. It does not benefit from integrity protection by SGX and thus, unlike the Enclave, can be subverted by an adversarial OS on the TC server to cause delays […]

Categories
Cryptocurrency Ethereum Mastering Development

How do financial derivatives offer stable value? From Ethereum Whitepaper

I’m having a hard time understanding what this paragraph in the section labeled “Financial derivatives and Stable-Value Currencies” means: Financial derivatives provide an alternative. Here, instead of a single issuer providing the funds to back up an asset, a decentralized market of speculators, betting that the price of a cryptographic reference asset (eg. ETH) will […]

Categories
Cryptocurrency Ethereum Mastering Development

Web3.js error message in Chrome, “Uncaught ReferenceError, Web is not defined”

I get the following Chrome (console) error when loading a UI for my contract using Web3. Console should print the Web3.js version number. JS is pasted below. Thank you. index.html:76 Uncaught ReferenceError: Web is not defined at index.html:76 (anonymous) @ index.html:76 index.html:110 Using web3 version: 1.2.5 index.html:114 Uncaught ReferenceError: abi is not defined at index.html:114 […]