Hi all,
below is my contract with compiler version >=0.6.0.
when I change the compiler version ^0.8.2 i am getting error as:
Return argument type address is not implicitly convertible to expected type (type of first return variable) address payable.
pragma solidity >=0.6.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
can anyone help me to sort out this issue?
Hi there,
When updating your compiler version, you should check to see if Open Zeppelin has created an updated version of the contract.
In this case, use the newest version of Context.sol at
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
This file has been truncated. show original
That should fix the issue.
1 Like
Thanks for the response @Yoshiko ,
I have another doubt " Is proxy contract compiler version and Implementation contract compiler version should be same? "
can I use the below combination in Binance smart chain?
proxy contract compiler version ^0.8.4 ,
Implementation contract compiler version >=0.6.12
Proxy and implementation contracts can be compiled with different Solidity versions
1 Like