mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4439 from ethereum/address_members
[BREAKING] Enforce address members not accessible by contract instance
This commit is contained in:
commit
e3c2f20f6e
@ -6,6 +6,7 @@ How to update your code:
|
||||
* Add ``public`` to every function and ``external`` to every fallback or interface function that does not specify its visibility already.
|
||||
* Make your fallback functions ``external``.
|
||||
* Explicitly state the storage location for local variables of struct and array types, e.g. change ``uint[] x = m_x`` to ``uint[] storage x = m_x``.
|
||||
* Explicitly convert values of contract type to addresses before using an ``address`` member. Example: if ``c`` is a contract, change ``c.transfer(...)`` to ``address(c).transfer(...)``.
|
||||
|
||||
|
||||
Breaking Changes:
|
||||
@ -47,6 +48,7 @@ Breaking Changes:
|
||||
* Type Checker: Only accept a single ``bytes`` type for ``.call()`` (and family), ``keccak256()``, ``sha256()`` and ``ripemd160()``.
|
||||
* Type Checker: Fallback function must be external. This was already the case in the experimental 0.5.0 mode.
|
||||
* Type Checker: Interface functions must be declared external. This was already the case in the experimental 0.5.0 mode.
|
||||
* Type Checker: Address members are not included in contract types anymore. An explicit conversion is now required before invoking an ``address`` member from a contract.
|
||||
* Remove obsolete ``std`` directory from the Solidity repository. This means accessing ``https://github.com/ethereum/soldity/blob/develop/std/*.sol`` (or ``https://github.com/ethereum/solidity/std/*.sol`` in Remix) will not be possible.
|
||||
* References Resolver: Turn missing storage locations into an error. This was already the case in the experimental 0.5.0 mode.
|
||||
* Syntax Checker: Named return values in function types are an error.
|
||||
|
@ -1930,6 +1930,9 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
else
|
||||
++it;
|
||||
}
|
||||
|
||||
auto& annotation = _memberAccess.annotation();
|
||||
|
||||
if (possibleMembers.size() == 0)
|
||||
{
|
||||
if (initialMemberCount == 0)
|
||||
@ -1947,11 +1950,21 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
" outside of storage."
|
||||
);
|
||||
}
|
||||
string errorMsg = "Member \"" + memberName + "\" not found or not visible "
|
||||
"after argument-dependent lookup in " + exprType->toString() +
|
||||
(memberName == "value" ? " - did you forget the \"payable\" modifier?" : ".");
|
||||
if (exprType->category() == Type::Category::Contract)
|
||||
for (auto const& addressMember: IntegerType(160, IntegerType::Modifier::Address).nativeMembers(nullptr))
|
||||
if (addressMember.name == memberName)
|
||||
{
|
||||
Identifier const* var = dynamic_cast<Identifier const*>(&_memberAccess.expression());
|
||||
string varName = var ? var->name() : "...";
|
||||
errorMsg += " Use \"address(" + varName + ")." + memberName + "\" to access this address member.";
|
||||
break;
|
||||
}
|
||||
m_errorReporter.fatalTypeError(
|
||||
_memberAccess.location(),
|
||||
"Member \"" + memberName + "\" not found or not visible "
|
||||
"after argument-dependent lookup in " + exprType->toString() +
|
||||
(memberName == "value" ? " - did you forget the \"payable\" modifier?" : ".")
|
||||
errorMsg
|
||||
);
|
||||
}
|
||||
else if (possibleMembers.size() > 1)
|
||||
@ -1962,7 +1975,6 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
(memberName == "value" ? " - did you forget the \"payable\" modifier?" : ".")
|
||||
);
|
||||
|
||||
auto& annotation = _memberAccess.annotation();
|
||||
annotation.referencedDeclaration = possibleMembers.front().declaration;
|
||||
annotation.type = possibleMembers.front().type;
|
||||
|
||||
@ -1995,20 +2007,6 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
|
||||
|
||||
if (exprType->category() == Type::Category::Contract)
|
||||
{
|
||||
// Warn about using address members on contracts
|
||||
bool v050 = m_scope->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050);
|
||||
for (auto const& addressMember: IntegerType(160, IntegerType::Modifier::Address).nativeMembers(nullptr))
|
||||
if (addressMember.name == memberName && *annotation.type == *addressMember.type)
|
||||
{
|
||||
solAssert(!v050, "Address member still present on contract in v0.5.0.");
|
||||
m_errorReporter.warning(
|
||||
_memberAccess.location(),
|
||||
"Using contract member \"" + memberName +"\" inherited from the address type is deprecated." +
|
||||
" Convert the contract to \"address\" type to access the member,"
|
||||
" for example use \"address(contract)." + memberName + "\" instead."
|
||||
);
|
||||
}
|
||||
|
||||
// Warn about using send or transfer with a non-payable fallback function.
|
||||
if (auto callType = dynamic_cast<FunctionType const*>(type(_memberAccess).get()))
|
||||
{
|
||||
|
@ -1873,47 +1873,9 @@ MemberList::MemberMap ContractType::nativeMembers(ContractDefinition const* _con
|
||||
&it.second->declaration()
|
||||
));
|
||||
}
|
||||
// In 0.5.0 address members are not populated into the contract.
|
||||
if (!_contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050))
|
||||
addNonConflictingAddressMembers(members);
|
||||
return members;
|
||||
}
|
||||
|
||||
void ContractType::addNonConflictingAddressMembers(MemberList::MemberMap& _members)
|
||||
{
|
||||
MemberList::MemberMap addressMembers = IntegerType(160, IntegerType::Modifier::Address).nativeMembers(nullptr);
|
||||
for (auto const& addressMember: addressMembers)
|
||||
{
|
||||
bool clash = false;
|
||||
for (auto const& member: _members)
|
||||
{
|
||||
if (
|
||||
member.name == addressMember.name &&
|
||||
(
|
||||
// Members with different types are not allowed
|
||||
member.type->category() != addressMember.type->category() ||
|
||||
// Members must overload functions without clash
|
||||
(
|
||||
member.type->category() == Type::Category::Function &&
|
||||
dynamic_cast<FunctionType const&>(*member.type).hasEqualArgumentTypes(dynamic_cast<FunctionType const&>(*addressMember.type))
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
clash = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!clash)
|
||||
_members.push_back(MemberList::Member(
|
||||
addressMember.name,
|
||||
addressMember.type,
|
||||
addressMember.declaration
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<FunctionType const> const& ContractType::newExpressionType() const
|
||||
{
|
||||
if (!m_constructorType)
|
||||
|
@ -740,8 +740,6 @@ public:
|
||||
std::vector<std::tuple<VariableDeclaration const*, u256, unsigned>> stateVariables() const;
|
||||
|
||||
private:
|
||||
static void addNonConflictingAddressMembers(MemberList::MemberMap& _members);
|
||||
|
||||
ContractDefinition const& m_contract;
|
||||
/// If true, it is the "super" type of the current contract, i.e. it contains only inherited
|
||||
/// members.
|
||||
|
@ -1214,63 +1214,52 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
|
||||
switch (_memberAccess.expression().annotation().type->category())
|
||||
{
|
||||
case Type::Category::Contract:
|
||||
case Type::Category::Integer:
|
||||
{
|
||||
bool alsoSearchInteger = false;
|
||||
if (_memberAccess.expression().annotation().type->category() == Type::Category::Contract)
|
||||
ContractType const& type = dynamic_cast<ContractType const&>(*_memberAccess.expression().annotation().type);
|
||||
if (type.isSuper())
|
||||
{
|
||||
ContractType const& type = dynamic_cast<ContractType const&>(*_memberAccess.expression().annotation().type);
|
||||
if (type.isSuper())
|
||||
{
|
||||
solAssert(!!_memberAccess.annotation().referencedDeclaration, "Referenced declaration not resolved.");
|
||||
utils().pushCombinedFunctionEntryLabel(m_context.superFunction(
|
||||
dynamic_cast<FunctionDefinition const&>(*_memberAccess.annotation().referencedDeclaration),
|
||||
type.contractDefinition()
|
||||
));
|
||||
}
|
||||
solAssert(!!_memberAccess.annotation().referencedDeclaration, "Referenced declaration not resolved.");
|
||||
utils().pushCombinedFunctionEntryLabel(m_context.superFunction(
|
||||
dynamic_cast<FunctionDefinition const&>(*_memberAccess.annotation().referencedDeclaration),
|
||||
type.contractDefinition()
|
||||
));
|
||||
}
|
||||
// ordinary contract type
|
||||
else if (Declaration const* declaration = _memberAccess.annotation().referencedDeclaration)
|
||||
{
|
||||
u256 identifier;
|
||||
if (auto const* variable = dynamic_cast<VariableDeclaration const*>(declaration))
|
||||
identifier = FunctionType(*variable).externalIdentifier();
|
||||
else if (auto const* function = dynamic_cast<FunctionDefinition const*>(declaration))
|
||||
identifier = FunctionType(*function).externalIdentifier();
|
||||
else
|
||||
{
|
||||
// ordinary contract type
|
||||
if (Declaration const* declaration = _memberAccess.annotation().referencedDeclaration)
|
||||
{
|
||||
u256 identifier;
|
||||
if (auto const* variable = dynamic_cast<VariableDeclaration const*>(declaration))
|
||||
identifier = FunctionType(*variable).externalIdentifier();
|
||||
else if (auto const* function = dynamic_cast<FunctionDefinition const*>(declaration))
|
||||
identifier = FunctionType(*function).externalIdentifier();
|
||||
else
|
||||
solAssert(false, "Contract member is neither variable nor function.");
|
||||
utils().convertType(type, IntegerType(160, IntegerType::Modifier::Address), true);
|
||||
m_context << identifier;
|
||||
}
|
||||
else
|
||||
// not found in contract, search in members inherited from address
|
||||
alsoSearchInteger = true;
|
||||
}
|
||||
solAssert(false, "Contract member is neither variable nor function.");
|
||||
utils().convertType(type, IntegerType(160, IntegerType::Modifier::Address), true);
|
||||
m_context << identifier;
|
||||
}
|
||||
else
|
||||
alsoSearchInteger = true;
|
||||
|
||||
if (alsoSearchInteger)
|
||||
solAssert(false, "Invalid member access in contract");
|
||||
break;
|
||||
}
|
||||
case Type::Category::Integer:
|
||||
{
|
||||
if (member == "balance")
|
||||
{
|
||||
if (member == "balance")
|
||||
{
|
||||
utils().convertType(
|
||||
*_memberAccess.expression().annotation().type,
|
||||
IntegerType(160, IntegerType::Modifier::Address),
|
||||
true
|
||||
);
|
||||
m_context << Instruction::BALANCE;
|
||||
}
|
||||
else if ((set<string>{"send", "transfer", "call", "callcode", "delegatecall"}).count(member))
|
||||
utils().convertType(
|
||||
*_memberAccess.expression().annotation().type,
|
||||
IntegerType(160, IntegerType::Modifier::Address),
|
||||
true
|
||||
);
|
||||
else
|
||||
solAssert(false, "Invalid member access to integer");
|
||||
utils().convertType(
|
||||
*_memberAccess.expression().annotation().type,
|
||||
IntegerType(160, IntegerType::Modifier::Address),
|
||||
true
|
||||
);
|
||||
m_context << Instruction::BALANCE;
|
||||
}
|
||||
else if ((set<string>{"send", "transfer", "call", "callcode", "delegatecall"}).count(member))
|
||||
utils().convertType(
|
||||
*_memberAccess.expression().annotation().type,
|
||||
IntegerType(160, IntegerType::Modifier::Address),
|
||||
true
|
||||
);
|
||||
else
|
||||
solAssert(false, "Invalid member access to integer");
|
||||
break;
|
||||
}
|
||||
case Type::Category::Function:
|
||||
|
@ -2083,7 +2083,7 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
|
||||
constructor() public payable {}
|
||||
function a(address addr, uint amount) public returns (uint) {
|
||||
addr.transfer(amount);
|
||||
return this.balance;
|
||||
return address(this).balance;
|
||||
}
|
||||
function b(address addr, uint amount) public {
|
||||
addr.transfer(amount);
|
||||
@ -2790,10 +2790,10 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses)
|
||||
}
|
||||
contract test {
|
||||
helper h;
|
||||
constructor() public payable { h = new helper(); h.send(5); }
|
||||
constructor() public payable { h = new helper(); address(h).send(5); }
|
||||
function getBalance() public returns (uint256 myBalance, uint256 helperBalance) {
|
||||
myBalance = this.balance;
|
||||
helperBalance = h.balance;
|
||||
myBalance = address(this).balance;
|
||||
helperBalance = address(h).balance;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@ -2808,7 +2808,7 @@ BOOST_AUTO_TEST_CASE(gas_and_value_basic)
|
||||
contract helper {
|
||||
bool flag;
|
||||
function getBalance() payable public returns (uint256 myBalance) {
|
||||
return this.balance;
|
||||
return address(this).balance;
|
||||
}
|
||||
function setFlag() public { flag = true; }
|
||||
function getFlag() public returns (bool fl) { return flag; }
|
||||
@ -2825,7 +2825,7 @@ BOOST_AUTO_TEST_CASE(gas_and_value_basic)
|
||||
}
|
||||
function checkState() public returns (bool flagAfter, uint myBal) {
|
||||
flagAfter = h.getFlag();
|
||||
myBal = this.balance;
|
||||
myBal = address(this).balance;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@ -2841,7 +2841,7 @@ BOOST_AUTO_TEST_CASE(value_complex)
|
||||
char const* sourceCode = R"(
|
||||
contract helper {
|
||||
function getBalance() payable public returns (uint256 myBalance) {
|
||||
return this.balance;
|
||||
return address(this).balance;
|
||||
}
|
||||
}
|
||||
contract test {
|
||||
@ -2862,7 +2862,7 @@ BOOST_AUTO_TEST_CASE(value_insane)
|
||||
char const* sourceCode = R"(
|
||||
contract helper {
|
||||
function getBalance() payable public returns (uint256 myBalance) {
|
||||
return this.balance;
|
||||
return address(this).balance;
|
||||
}
|
||||
}
|
||||
contract test {
|
||||
@ -2897,7 +2897,7 @@ BOOST_AUTO_TEST_CASE(value_for_constructor)
|
||||
}
|
||||
function getFlag() public returns (bool ret) { return h.getFlag(); }
|
||||
function getName() public returns (bytes3 ret) { return h.getName(); }
|
||||
function getBalances() public returns (uint me, uint them) { me = this.balance; them = h.balance;}
|
||||
function getBalances() public returns (uint me, uint them) { me = address(this).balance; them = address(h).balance;}
|
||||
}
|
||||
)";
|
||||
compileAndRun(sourceCode, 22, "Main");
|
||||
@ -3341,7 +3341,7 @@ BOOST_AUTO_TEST_CASE(default_fallback_throws)
|
||||
char const* sourceCode = R"YY(
|
||||
contract A {
|
||||
function f() public returns (bool) {
|
||||
return this.call("");
|
||||
return address(this).call("");
|
||||
}
|
||||
}
|
||||
)YY";
|
||||
@ -4066,7 +4066,7 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes)
|
||||
contract sender {
|
||||
constructor() public { rec = new receiver(); }
|
||||
function() external { savedData = msg.data; }
|
||||
function forward() public returns (bool) { !rec.call(savedData); return true; }
|
||||
function forward() public returns (bool) { !address(rec).call(savedData); return true; }
|
||||
function clear() public returns (bool) { delete savedData; return true; }
|
||||
function val() public returns (uint) { return rec.received(); }
|
||||
receiver rec;
|
||||
@ -4095,18 +4095,18 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length)
|
||||
receiver rec;
|
||||
constructor() public { rec = new receiver(); }
|
||||
function viaCalldata() public returns (uint) {
|
||||
require(rec.call(msg.data));
|
||||
require(address(rec).call(msg.data));
|
||||
return rec.calledLength();
|
||||
}
|
||||
function viaMemory() public returns (uint) {
|
||||
bytes memory x = msg.data;
|
||||
require(rec.call(x));
|
||||
require(address(rec).call(x));
|
||||
return rec.calledLength();
|
||||
}
|
||||
bytes s;
|
||||
function viaStorage() public returns (uint) {
|
||||
s = msg.data;
|
||||
require(rec.call(s));
|
||||
require(address(rec).call(s));
|
||||
return rec.calledLength();
|
||||
}
|
||||
}
|
||||
@ -4137,8 +4137,8 @@ BOOST_AUTO_TEST_CASE(copying_bytes_multiassign)
|
||||
constructor() public { rec = new receiver(); }
|
||||
function() external { savedData1 = savedData2 = msg.data; }
|
||||
function forward(bool selector) public returns (bool) {
|
||||
if (selector) { rec.call(savedData1); delete savedData1; }
|
||||
else { rec.call(savedData2); delete savedData2; }
|
||||
if (selector) { address(rec).call(savedData1); delete savedData1; }
|
||||
else { address(rec).call(savedData2); delete savedData2; }
|
||||
return true;
|
||||
}
|
||||
function val() public returns (uint) { return rec.received(); }
|
||||
@ -4592,8 +4592,8 @@ BOOST_AUTO_TEST_CASE(bytes_in_arguments)
|
||||
function g(uint a) public { result *= a; }
|
||||
function test(uint a, bytes data1, bytes data2, uint b) external returns (uint r_a, uint r, uint r_b, uint l) {
|
||||
r_a = a;
|
||||
this.call(data1);
|
||||
this.call(data2);
|
||||
address(this).call(data1);
|
||||
address(this).call(data2);
|
||||
r = result;
|
||||
r_b = b;
|
||||
l = data1.length;
|
||||
@ -6472,7 +6472,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail)
|
||||
contract A {
|
||||
constructor() public
|
||||
{
|
||||
this.call("123");
|
||||
address(this).call("123");
|
||||
}
|
||||
}
|
||||
contract B {
|
||||
@ -6536,7 +6536,7 @@ BOOST_AUTO_TEST_CASE(failing_send)
|
||||
constructor() public payable {}
|
||||
function callHelper(address _a) public returns (bool r, uint bal) {
|
||||
r = !_a.send(5);
|
||||
bal = this.balance;
|
||||
bal = address(this).balance;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@ -6559,7 +6559,7 @@ BOOST_AUTO_TEST_CASE(send_zero_ether)
|
||||
constructor() public payable {}
|
||||
function s() public returns (bool) {
|
||||
Receiver r = new Receiver();
|
||||
return r.send(0);
|
||||
return address(r).send(0);
|
||||
}
|
||||
}
|
||||
)";
|
||||
@ -9742,7 +9742,7 @@ BOOST_AUTO_TEST_CASE(calling_nonexisting_contract_throws)
|
||||
return 7;
|
||||
}
|
||||
function h() public returns (uint) {
|
||||
d.call(""); // this does not throw (low-level)
|
||||
address(d).call(""); // this does not throw (low-level)
|
||||
return 7;
|
||||
}
|
||||
}
|
||||
@ -11503,7 +11503,7 @@ BOOST_AUTO_TEST_CASE(bubble_up_error_messages_through_transfer)
|
||||
revert("message");
|
||||
}
|
||||
function f() public {
|
||||
this.transfer(0);
|
||||
address(this).transfer(0);
|
||||
}
|
||||
}
|
||||
contract C {
|
||||
@ -11778,13 +11778,13 @@ BOOST_AUTO_TEST_CASE(delegatecall_return_value)
|
||||
return value;
|
||||
}
|
||||
function get_delegated() external returns (bool) {
|
||||
return this.delegatecall(abi.encodeWithSignature("get()"));
|
||||
return address(this).delegatecall(abi.encodeWithSignature("get()"));
|
||||
}
|
||||
function assert0() external view {
|
||||
assert(value == 0);
|
||||
}
|
||||
function assert0_delegated() external returns (bool) {
|
||||
return this.delegatecall(abi.encodeWithSignature("assert0()"));
|
||||
return address(this).delegatecall(abi.encodeWithSignature("assert0()"));
|
||||
}
|
||||
}
|
||||
)DELIMITER";
|
||||
@ -12494,7 +12494,7 @@ BOOST_AUTO_TEST_CASE(abi_encode_call)
|
||||
uint[] memory b = new uint[](2);
|
||||
b[0] = 6;
|
||||
b[1] = 7;
|
||||
require(this.call(abi.encodeWithSignature("c(uint256,uint256[])", a, b)));
|
||||
require(address(this).call(abi.encodeWithSignature("c(uint256,uint256[])", a, b)));
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
// This used to be a test for a.transfer to generate a warning
|
||||
// because A's fallback function is not payable.
|
||||
|
||||
contract A {
|
||||
function() external {}
|
||||
}
|
||||
|
||||
contract B {
|
||||
A a;
|
||||
|
||||
function() external {
|
||||
a.transfer(100);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (213-223): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
|
||||
// TypeError: (213-223): Value transfer to a contract without a payable fallback function.
|
@ -1,15 +0,0 @@
|
||||
// This used to be a test for a.transfer to generate a warning
|
||||
// because A does not have a payable fallback function.
|
||||
|
||||
contract A {}
|
||||
|
||||
contract B {
|
||||
A a;
|
||||
|
||||
function() external {
|
||||
a.transfer(100);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (192-202): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
|
||||
// TypeError: (192-202): Value transfer to a contract without a payable fallback function.
|
@ -1,17 +0,0 @@
|
||||
// This used to be a test for a.send to generate a warning
|
||||
// because A does not have a payable fallback function.
|
||||
|
||||
contract A {
|
||||
function() external {}
|
||||
}
|
||||
|
||||
contract B {
|
||||
A a;
|
||||
|
||||
function() external {
|
||||
require(a.send(100));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (224-230): Using contract member "send" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).send" instead.
|
||||
// TypeError: (224-230): Value transfer to a contract without a payable fallback function.
|
@ -9,8 +9,7 @@ contract B {
|
||||
A a;
|
||||
|
||||
function() external {
|
||||
a.transfer(100);
|
||||
address(a).transfer(100);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (228-238): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
|
||||
|
@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-64): Using contract member "balance" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).balance" instead.
|
||||
// TypeError: (52-64): Member "balance" not found or not visible after argument-dependent lookup in contract C. Use "address(this).balance" to access this address member.
|
||||
|
@ -4,5 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-65): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
|
||||
// TypeError: (52-65): Value transfer to a contract without a payable fallback function.
|
||||
// TypeError: (52-65): Member "transfer" not found or not visible after argument-dependent lookup in contract C. Use "address(this).transfer" to access this address member.
|
||||
|
@ -4,5 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-61): Using contract member "send" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).send" instead.
|
||||
// TypeError: (52-61): Value transfer to a contract without a payable fallback function.
|
||||
// TypeError: (52-61): Member "send" not found or not visible after argument-dependent lookup in contract C. Use "address(this).send" to access this address member.
|
||||
|
@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-61): Using contract member "call" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).call" instead.
|
||||
// TypeError: (52-61): Member "call" not found or not visible after argument-dependent lookup in contract C. Use "address(this).call" to access this address member.
|
||||
|
@ -4,5 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-65): Using contract member "callcode" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).callcode" instead.
|
||||
// TypeError: (52-65): "callcode" has been deprecated in favour of "delegatecall".
|
||||
// TypeError: (52-65): Member "callcode" not found or not visible after argument-dependent lookup in contract C. Use "address(this).callcode" to access this address member.
|
||||
|
@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (52-69): Using contract member "delegatecall" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).delegatecall" instead.
|
||||
// TypeError: (52-69): Member "delegatecall" not found or not visible after argument-dependent lookup in contract C. Use "address(this).delegatecall" to access this address member.
|
||||
|
@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-74): Using contract member "balance" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).balance" instead.
|
||||
// TypeError: (65-74): Member "balance" not found or not visible after argument-dependent lookup in contract C. Use "address(c).balance" to access this address member.
|
||||
|
@ -5,5 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-75): Using contract member "transfer" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).transfer" instead.
|
||||
// TypeError: (65-75): Value transfer to a contract without a payable fallback function.
|
||||
// TypeError: (65-75): Member "transfer" not found or not visible after argument-dependent lookup in contract C. Use "address(c).transfer" to access this address member.
|
||||
|
@ -5,5 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-71): Using contract member "send" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).send" instead.
|
||||
// TypeError: (65-71): Value transfer to a contract without a payable fallback function.
|
||||
// TypeError: (65-71): Member "send" not found or not visible after argument-dependent lookup in contract C. Use "address(c).send" to access this address member.
|
||||
|
@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-71): Using contract member "call" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).call" instead.
|
||||
// TypeError: (65-71): Member "call" not found or not visible after argument-dependent lookup in contract C. Use "address(c).call" to access this address member.
|
||||
|
@ -5,5 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-75): Using contract member "callcode" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).callcode" instead.
|
||||
// TypeError: (65-75): "callcode" has been deprecated in favour of "delegatecall".
|
||||
// TypeError: (65-75): Member "callcode" not found or not visible after argument-dependent lookup in contract C. Use "address(c).callcode" to access this address member.
|
||||
|
@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (65-79): Using contract member "delegatecall" inherited from the address type is deprecated. Convert the contract to "address" type to access the member, for example use "address(contract).delegatecall" instead.
|
||||
// TypeError: (65-79): Member "delegatecall" not found or not visible after argument-dependent lookup in contract C. Use "address(c).delegatecall" to access this address member.
|
||||
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.balance;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-89): Member "balance" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.transfer;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-90): Member "transfer" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.send;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-86): Member "send" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.call;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-86): Member "call" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.callcode;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-90): Member "callcode" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,8 +0,0 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function f() public {
|
||||
this.delegatecall;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (77-94): Member "delegatecall" not found or not visible after argument-dependent lookup in contract C.
|
@ -1,4 +1,3 @@
|
||||
pragma experimental "v0.5.0";
|
||||
contract C {
|
||||
function transfer(uint) public;
|
||||
function f() public {
|
||||
|
@ -0,0 +1,6 @@
|
||||
contract C {
|
||||
function f() public returns (C) { return this; }
|
||||
function g() public returns (uint) { return f().balance(); }
|
||||
}
|
||||
// ----
|
||||
// TypeError: (114-125): Member "balance" not found or not visible after argument-dependent lookup in contract C. Use "address(...).balance" to access this address member.
|
Loading…
Reference in New Issue
Block a user