Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC20 is not available on solana #1174

Open
vinodsharmak opened this issue Feb 13, 2023 · 4 comments
Open

ERC20 is not available on solana #1174

vinodsharmak opened this issue Feb 13, 2023 · 4 comments
Labels
solana The Solana target

Comments

@vinodsharmak
Copy link

I am trying to compile my contract but getting

error: 'msg.sender' is not available on Solana. See https://solang.readthedocs.io/en/latest/targets/solana.html#msg-sender-solana
┌─ D:\Github\solana-solidity\ERC20.sol:380:16

380 │ return msg.sender;

Please let me know how I can fix this ? or is there any alternative for "msg.Sender"

@xermicus
Copy link
Contributor

Hi @vinodsharmak

The documentation you linked literally answers your question:

The way to implement this on Solana is to have an authority account for the contract that must be a signer for the transaction (note that on Solana there can be many signers too). This is a common construct on Solana contracts.

@seanyoung
Copy link
Contributor

@vinodsharmak can you show us the solidity you are trying to compile, so we can help you re-write it without msg.sender?

@seanyoung seanyoung reopened this Feb 13, 2023
@vinodsharmak
Copy link
Author

Hi @seanyoung Here is the sol
ERC20.txt

@seanyoung
Copy link
Contributor

@vinodsharmak you are right, we need an ERC20 example that works on Solana. We should add this to our to do list.

@seanyoung seanyoung changed the title msg.Sender is not available on solana ERC20 is not available on solana Feb 15, 2023
@seanyoung seanyoung added the solana The Solana target label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solana The Solana target
Projects
None yet
Development

No branches or pull requests

3 participants