@@ -1597,29 +1597,9 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
15971597
15981598 break ;
15991599 }
1600- case FunctionType::Kind::SetTransferRate: {
1601- solAssert (arguments.size () == 1 , " argument's size doesn't math parameter" );
1602-
1603- /* address */
1604- _functionCall.expression ().accept (*this );
1605-
1606- /* argument (string memory) */
1607- prepareSQLCallMemParams (arguments, parameterTypes);
1608-
1609- m_context << Instruction::DUP2 << Instruction::DUP2
1610- << Instruction::DUP5 << Instruction::EXTRANSFERRATESET
1611- << swapInstruction (3 );
1612-
1613- utils ().popStackSlots (3 );
1614-
1615- m_context << Instruction::ISZERO;
1616- m_context.appendConditionalRevertDIY (true );
1617-
1618- break ;
1619- }
1620- case FunctionType::Kind::SetTransferRange:
1600+ case FunctionType::Kind::SetTransferFee:
16211601 {
1622- solAssert (arguments.size () == 2 , " argument's size doesn't math parameter" );
1602+ solAssert (arguments.size () == 3 , " argument's size doesn't math parameter" );
16231603
16241604 /* address */
16251605 _functionCall.expression ().accept (*this );
@@ -1629,10 +1609,11 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
16291609
16301610 m_context << Instruction::DUP2 << Instruction::DUP2
16311611 << Instruction::DUP6 << Instruction::DUP6
1632- << Instruction::DUP9 << Instruction::EXTRANSFERRANGESET
1633- << swapInstruction (5 );
1612+ << Instruction::DUP10 << Instruction::DUP10
1613+ << Instruction::DUP13 << Instruction::EXTRANSFERFEESET
1614+ << swapInstruction (7 );
16341615
1635- utils ().popStackSlots (5 );
1616+ utils ().popStackSlots (7 );
16361617
16371618 m_context << Instruction::ISZERO;
16381619 m_context.appendConditionalRevertDIY (true );
@@ -1673,18 +1654,32 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
16731654 case FunctionType::Kind::TrustLimit:
16741655 case FunctionType::Kind::GateWayBalance:
16751656 {
1676- solAssert (arguments.size () == 2 , " argument's size doesn't math parameter" );
1657+ solAssert (arguments.size () == 3 , " argument's size doesn't math parameter" );
16771658
16781659 /* address */
16791660 _functionCall.expression ().accept (*this );
1661+ auto arg = arguments.begin ();
1662+ auto param = parameterTypes.begin ();
16801663
16811664 /* argument (string memory) */
1682- copyParamToMemory (*arguments.begin (), *parameterTypes.begin ());
1665+ copyParamToMemory (*arg, *param);
1666+
1667+ ++arg;
1668+ ++param;
1669+
1670+ /* argument (uint64) */
1671+ TypePointer const &argType1 = (*arg)->annotation ().type ;
1672+ solAssert (argType1, " " );
1673+ (*arg)->accept (*this );
1674+ utils ().convertType (*argType1, **param, true );
1675+
1676+ ++arg;
1677+ ++param;
16831678
16841679 /* * argument (address) */
1685- auto const &argType = arguments. back ( )->annotation ().type ;
1686- solAssert (argType , " " );
1687- arguments. back ( )->accept (*this );
1680+ auto const &argType2 = (*arg )->annotation ().type ;
1681+ solAssert (argType2 , " " );
1682+ (*arg )->accept (*this );
16881683
16891684 Instruction cmd = Instruction::EXTRUSTLIMIT;
16901685 switch (function.kind ())
@@ -1700,22 +1695,23 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
17001695 }
17011696
17021697 m_context << Instruction::DUP1
1703- << Instruction::DUP4 << Instruction::DUP4
1704- << Instruction::DUP7 << cmd
1705- << swapInstruction (4 );
1698+ << Instruction::DUP3
1699+ << Instruction::DUP6 << Instruction::DUP6
1700+ << Instruction::DUP9 << cmd
1701+ << swapInstruction (5 );
17061702
1707- utils ().popStackSlots (4 );
1703+ utils ().popStackSlots (5 );
17081704
17091705 break ;
17101706 }
17111707 case FunctionType::Kind::Pay:
17121708 {
1713- solAssert (arguments.size () == 4 , " argument's size doesn't math parameter" );
1709+ solAssert (arguments.size () == 5 , " argument's size doesn't math parameter" );
17141710
1715- /* address */
1711+ /* address sender */
17161712 _functionCall.expression ().accept (*this );
17171713
1718- /* * argument (address) */
1714+ /* * argument (address reciever ) */
17191715 auto const &argType1 = arguments.front ()->annotation ().type ;
17201716 solAssert (argType1, " " );
17211717 arguments.front ()->accept (*this );
@@ -1726,20 +1722,16 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
17261722 TypePointers params (parameterTypes.begin () + 1 , parameterTypes.end () - 1 );
17271723 prepareSQLCallMemParams (memArguments, params);
17281724
1729- /* * argument (address) */
1725+ /* * argument (address gateway ) */
17301726 auto const &argType2 = arguments.back ()->annotation ().type ;
17311727 solAssert (argType2, " " );
17321728 arguments.back ()->accept (*this );
17331729
1734- m_context << Instruction::DUP1
1735- << Instruction::DUP4 << Instruction::DUP4
1736- << Instruction::DUP8 << Instruction::DUP8
1737- << Instruction::DUP11
1738- << Instruction::DUP13
1739- << Instruction::EXPAY
1740- << swapInstruction (7 );
1730+ utils ().copyToStackTop (9 , 9 );
17411731
1742- utils ().popStackSlots (7 );
1732+ m_context << Instruction::EXPAY << swapInstruction (9 );
1733+
1734+ utils ().popStackSlots (9 );
17431735
17441736 m_context << Instruction::ISZERO;
17451737 m_context.appendConditionalRevertDIY (true );
@@ -1896,8 +1888,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
18961888 case FunctionType::Kind::DeleteSQL:
18971889 case FunctionType::Kind::UpdateSQL:
18981890 case FunctionType::Kind::AccountSet:
1899- case FunctionType::Kind::SetTransferRate:
1900- case FunctionType::Kind::SetTransferRange:
1891+ case FunctionType::Kind::SetTransferFee:
19011892 case FunctionType::Kind::TrustSet:
19021893 case FunctionType::Kind::TrustLimit:
19031894 case FunctionType::Kind::GateWayBalance:
@@ -2107,7 +2098,11 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
21072098 true
21082099 );
21092100 }
2110- else if ((set<string>{" call" , " callcode" , " delegatecall" , " staticcall" }).count (member))
2101+ else if ((set<string>{" call" , " callcode" , " delegatecall" , " staticcall" ,
2102+ " create" , " drop" , " rename" , " insert" ,
2103+ " deletex" , " update" , " grant" , " get" ,
2104+ " accountSet" , " setTransferFee" , " trustSet" ,
2105+ " trustLimit" , " gatewayBalance" , " pay" }).count (member))
21112106 utils ().convertType (
21122107 *_memberAccess.expression ().annotation ().type ,
21132108 *TypeProvider::address (),
0 commit comments