0

i have set wallet address that only owner can change, but i can not read the wallet address. my view functions giving me this error

here is the code

pragma solidity 0.8.0;

// SPDX-License-Identifier: MIT


contract NFT {
    uint256 public fauouRiteNum;
    
    mapping(address => address) private wallet;
    
    
     
    function setNumber(uint256 _fav) public returns(uint256){
        return fauouRiteNum=_fav;
    }
    
    function marketing(address _add) public returns(address){
         wallet[msg.sender] = _add;
    }
    
    function getWallet(uint256 _wallet) public view returns(uint256){
    return wallet=_wallet;
    }
}
    
    
    
6
  • Shouldn’t be a mapping from address to address ? And not from address to number ?
    – Majd TL
    Sep 11 at 15:47
  • i did change it to address to address but it gives me 0*00000 address while i add a full address !
    – stofu
    Sep 11 at 15:52
  • What gives you 0x000000…? How are u calling it ?
    – Majd TL
    Sep 11 at 15:55
  • i am setting the address: plz try this on remix, you will know
    – stofu
    Sep 11 at 16:11
  • how can i read the set marketing wallet address? my view function gives me error
    – stofu
    Sep 11 at 16:19
0
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;

contract NFT {
    uint256 public fauouRiteNum;
  
    mapping(address => address) private wallet;
     
    function setNumber(uint256 _fav) public returns(uint256) {
        return fauouRiteNum=_fav;
    }
    
    function marketing(address _add) public {
         wallet[msg.sender] = _add;
    }
    
    function getWallet() public view returns(address) {
        return wallet[msg.sender];
    }
    
}

enter image description here

4
  • hello, can you plz take a look here. the transfer functionality is not working. `(github.com/coderbang1/transfer-token/tree/main)
    – stofu
    Sep 12 at 15:55
  • @stofu sorry no time and experience to read a complex contract , if u have another question please post it and maybe someone could help
    – Majd TL
    Sep 12 at 16:08
  • can you solve this one: CompilerError: Stack too deep, try removing local variables.
    – stofu
    Sep 12 at 20:55
  • @stofu ethereum.stackexchange.com/search?q=stack+too+deep there are many reasons for this problem. try to find one of the solution from other questions about it
    – Majd TL
    Sep 13 at 7:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.