Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
neo hong committed Jun 3, 2021
1 parent 2b6cc96 commit d1802f2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pragma solidity >=0.6.0 <0.8.0;
contract HelloWorld {
function helloWorld() external pure returns (string memory) {
return "Hello, World!";
return "Hello, World!";
}
}
```
Expand Down
26 changes: 25 additions & 1 deletion libsolidity/analysis/GlobalContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ int magicVariableToID(std::string const& _name)
return -7;
else if (_name == "keccak256")
return -8;
else if (_name == "log0")
return -10;
else if (_name == "log1")
return -11;
else if (_name == "log2")
return -12;
else if (_name == "log3")
return -13;
else if (_name == "log4")
return -14;
else if (_name == "msg")
return -15;
else if (_name == "mulmod")
Expand Down Expand Up @@ -149,6 +159,20 @@ inline vector<shared_ptr<MagicVariableDeclaration const>> constructMagicVariable
FunctionType::Kind::KECCAK256,
false,
StateMutability::Pure)),
magicVarDecl("log0", TypeProvider::function(strings{"bytes32"}, strings{}, FunctionType::Kind::Log0)),
magicVarDecl(
"log1", TypeProvider::function(strings{"bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log1)),
magicVarDecl(
"log2",
TypeProvider::function(strings{"bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log2)),
magicVarDecl(
"log3",
TypeProvider::
function(strings{"bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log3)),
magicVarDecl(
"log4",
TypeProvider::function(
strings{"bytes32", "bytes32", "bytes32", "bytes32", "bytes32"}, strings{}, FunctionType::Kind::Log4)),
magicVarDecl("msg", TypeProvider::magic(MagicType::Kind::Message)),
magicVarDecl(
"mulmod",
Expand Down Expand Up @@ -526,7 +550,7 @@ MagicVariableDeclaration const* GlobalContext::currentSuper() const
{
Type const* type = TypeProvider::emptyTuple();
if (m_currentContract)
type = TypeProvider::typeType(TypeProvider::contract(*m_currentContract, true));
type = TypeProvider::contract(*m_currentContract, true);
m_superPointer[m_currentContract] =
make_shared<MagicVariableDeclaration>(magicVariableToID("super"), "super", type);
}
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/ast/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ class FunctionType: public Type
bool const m_arbitraryParameters = false;
bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack
bool const m_valueSet = false; ///< true iff the value to be sent is on the stack
bool const m_tokenSet = false;
bool const m_tokenSet = false;
/// true iff the function is called as arg1.fun(arg2, ..., argn).
/// This is achieved through the "using for" directive.
bool const m_bound = false;
Expand Down
4 changes: 2 additions & 2 deletions test/libsolidity/SolidityExpressionCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ BOOST_AUTO_TEST_CASE(int_with_gwei_ether_subdenomination)
{
char const* sourceCode = R"(
contract test {
function test () {
uint x = 100 sun;
function f() public {
uint x = 100 sun;
}
}
)";
Expand Down

0 comments on commit d1802f2

Please sign in to comment.