mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1325 from LefterisJP/sol_MsgSig
Adding msg.sig Solidity Magic type
This commit is contained in:
commit
c34e1da6db
@ -652,6 +652,9 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess)
|
|||||||
m_context << eth::Instruction::GASPRICE;
|
m_context << eth::Instruction::GASPRICE;
|
||||||
else if (member == "data")
|
else if (member == "data")
|
||||||
m_context << u256(0) << eth::Instruction::CALLDATASIZE;
|
m_context << u256(0) << eth::Instruction::CALLDATASIZE;
|
||||||
|
else if (member == "sig")
|
||||||
|
m_context << u256(0) << eth::Instruction::CALLDATALOAD
|
||||||
|
<< (u256(0xffffffff) << (256 - 32)) << eth::Instruction::AND;
|
||||||
else
|
else
|
||||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown magic member."));
|
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown magic member."));
|
||||||
break;
|
break;
|
||||||
|
@ -1160,7 +1160,8 @@ MagicType::MagicType(MagicType::Kind _kind):
|
|||||||
m_members = MemberList({{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
|
m_members = MemberList({{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
|
||||||
{"gas", make_shared<IntegerType>(256)},
|
{"gas", make_shared<IntegerType>(256)},
|
||||||
{"value", make_shared<IntegerType>(256)},
|
{"value", make_shared<IntegerType>(256)},
|
||||||
{"data", make_shared<ArrayType>(ArrayType::Location::CallData)}});
|
{"data", make_shared<ArrayType>(ArrayType::Location::CallData)},
|
||||||
|
{"sig", make_shared<FixedBytesType>(4)}});
|
||||||
break;
|
break;
|
||||||
case Kind::Transaction:
|
case Kind::Transaction:
|
||||||
m_members = MemberList({{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
|
m_members = MemberList({{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
|
||||||
|
Loading…
Reference in New Issue
Block a user