Skip to content

Commit

Permalink
feat!: generate on-chain getters for public state variables
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-liu committed Dec 15, 2021
1 parent 0c1b92b commit 3726ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libsolidity/ast/AST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ vector<pair<util::FixedHash<4>, FunctionTypePointer>> const& ContractDefinition:
for (FunctionDefinition const* f: contract->definedFunctions())
if (f->isPartOfExternalInterface())
functions.push_back(TypeProvider::function(*f, FunctionType::Kind::External));
// Solidity++: disable automatic getter generating for public state variables
// for (VariableDeclaration const* v: contract->stateVariables())
// if (v->isPartOfExternalInterface())
// functions.push_back(TypeProvider::function(*v));
for (VariableDeclaration const* v: contract->stateVariables())
if (v->isPartOfExternalInterface())
functions.push_back(TypeProvider::function(*v));
for (FunctionTypePointer const& fun: functions)
{
if (!fun->interfaceFunctionType())
Expand Down
1 change: 1 addition & 0 deletions libsolidity/ast/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,7 @@ FunctionType::FunctionType(FunctionDefinition const& _function, Kind _kind):
FunctionType::FunctionType(VariableDeclaration const& _varDecl):
m_kind(Kind::External),
m_stateMutability(StateMutability::View),
m_executionBehavior(ExecutionBehavior::Async), // Solidity++
m_declaration(&_varDecl)
{
auto returnType = _varDecl.annotation().type;
Expand Down

0 comments on commit 3726ab4

Please sign in to comment.