0

I get an error that says no contract instances to interact with when trying to deploy my

pragma solidity ^0.8.3 

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";

contract Gaia {
    
    mapping(address => uint) public balances;
    mapping(address => mapping(address => uint)) public allowance;
    uint public totalSupply = 100000000 * 10 ** 18;
    string public name = "Gaia coin";
    string public symbol = "GAIA";
    uint public decimals = 18
    
    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
    constructor() {
        balances[msg.sender] = totalSupply;
    }
    
    function balanceOf(address owner) public view returns(uint) {
        return balances[owner];
    }
    
    function transfer(address to, uint value) public returns(bool) {
        require(balanceOf(msg.sender)>= value, 'balance too low')
        balances[to] += value;
        balances[msg.sender] -= value;
        emit Transfer(msg.sender, to, value);
        return true;
    }
    function transferFrom(address from, address to, uint value) public returns(bool) {
        require(balanceOf(from) >= value, 'balance too low');
        require(allowance[from][msg.sender] >= value, 'allowance too low');
        balances[to] +=(value);
        balances[from].sub(value);
        emit Transfer(from, to, value);
        return true
    
    function approve(address spender, uint value) public returns(bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }
    
    function charity(address from, address(Oxd4Af23dF6A52ce4eBE511dC09E8E7d102e62e918) to, uint value) public returns(bool) {
        require(balanceOf(from) >= value, 'balance too low');
        require(allowance[from][msg.sender] >= value, 'allowance too low');
        balances[to] +=(value * 0.75);
        balances[from].sub(value * 0.75);
        emit Transfer(from, to, value * 0.75);
        return true
    }
}
2
  • 1
    The problem is most likely not in the contract code, but the way you are deploying it which is not shown. – Rob Hitchens Mar 24 at 21:54
  • It won’t led me add a picture but the environment is injected web3 to a smart chain test net account – Jack Scully Mar 24 at 23:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.