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

BitDAO uses msg.sender rather than _msgSender() #18

Open
CjHare opened this issue Sep 13, 2021 · 0 comments
Open

BitDAO uses msg.sender rather than _msgSender() #18

CjHare opened this issue Sep 13, 2021 · 0 comments
Labels
question Further information is requested

Comments

@CjHare
Copy link
Contributor

CjHare commented Sep 13, 2021

The BitDAO contract extends ERC20 contract uses the Context (supporting Ethereum Gas Station Network v1) contract.

To accommodate the GSN contracts need to replace msg.sender with _msgSender(), as when using the GSN the msg.sender` is not the actual sender but the GSN contract.

The BitDAO only uses msg.sender, which may cause issues if BITs are ever used with the GSN


	modifier onlyAdmin {
		require(msg.sender == admin, 'Caller is not a admin');
		_;
	}```

``` line 836 – BitDAO.sol
	function setPendingAdmin(address newPendingAdmin) external returns (bool) {
		if (msg.sender != admin) {
			revert('BitDAO:setPendingAdmin:illegal address');
		}
...

	function acceptAdmin() external returns (bool) {
		if (msg.sender != pendingAdmin || msg.sender == address(0)) {
			revert('BitDAO:acceptAdmin:illegal address');
		}
...
	function delegate(address delegatee) external {
		return _delegate(msg.sender, delegatee);
	}

There could be a case for these operations to require direct calls (excluding all intermediary/proxy contracts, such as GSN), however was that the intention?

@CjHare CjHare added the question Further information is requested label Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant