I'm having issues sending ETH to an extremely basic smart contract. Here's the smart contract code:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
contract hodl {
uint num;
uint value;
constructor() {
num = 69;
value = 0;
}
event showNum(uint num);
event seeSender(address addy, uint value);
fallback() external payable {
emit seeSender(msg.sender, msg.value);
emit showNum(num);
num += 1;
}
function printNum() public returns (uint y){
emit showNum(num);
return num;
}
function printValue() public returns (uint y){
return value;
}
}
Here's the deployment code if it matters (file name is 2_deploy_contract.js):
const hodl = artifacts.require("hodl.sol");
module.exports = function (deployer) {
deployer.deploy(hodl);
};
Here's the output from my terminal:
truffle(ganache)> c = await hodl.deployed()
undefined
truffle(ganache)> c.sendTransaction({from: ‘0x40Fdb0DceC71c8e3b414FB04351C9eDd45116120’, value: ‘1000000000000000'})
evalmachine.<anonymous>:0
c.sendTransaction({from: ‘0x40Fdb0DceC71c8e3b414FB04351C9eDd45116120’, value: ‘1000000000000000'})
Uncaught SyntaxError: Invalid or unexpected token
truffle(ganache)>
'
or double quotes"
. The character you are using isn't the correct one‘
.