Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ├─ type: SourceUnit
- └─ children
- ├─ 0
- │ ├─ type: PragmaDirective
- │ ├─ name: solidity
- │ └─ value: 0.5.8
- ├─ 1
- │ ├─ type: ImportDirective
- │ ├─ path: openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol
- │ ├─ unitAlias
- │ └─ symbolAliases
- ├─ 2
- │ ├─ type: ImportDirective
- │ ├─ path: openzeppelin-solidity/contracts/ownership/Ownable.sol
- │ ├─ unitAlias
- │ └─ symbolAliases
- ├─ 3
- │ ├─ type: ImportDirective
- │ ├─ path: openzeppelin-solidity/contracts/math/SafeMath.sol
- │ ├─ unitAlias
- │ └─ symbolAliases
- ├─ 4
- │ ├─ type: ImportDirective
- │ ├─ path: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
- │ ├─ unitAlias
- │ └─ symbolAliases
- ├─ 5
- │ ├─ type: ImportDirective
- │ ├─ path: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
- │ ├─ unitAlias
- │ └─ symbolAliases
- └─ 6
- ├─ type: ContractDefinition
- ├─ name: OkgExchange
- ├─ baseContracts
- │ ├─ 0
- │ │ ├─ type: InheritanceSpecifier
- │ │ ├─ baseName
- │ │ │ ├─ type: UserDefinedTypeName
- │ │ │ └─ namePath: Ownable
- │ │ └─ arguments
- │ └─ 1
- │ ├─ type: InheritanceSpecifier
- │ ├─ baseName
- │ │ ├─ type: UserDefinedTypeName
- │ │ └─ namePath: WhitelistedRole
- │ └─ arguments
- ├─ subNodes
- │ ├─ 0
- │ │ ├─ type: UsingForDeclaration
- │ │ ├─ typeName
- │ │ │ ├─ type: ElementaryTypeName
- │ │ │ └─ name: uint256
- │ │ └─ libraryName: SafeMath
- │ ├─ 1
- │ │ ├─ type: UsingForDeclaration
- │ │ ├─ typeName
- │ │ │ ├─ type: UserDefinedTypeName
- │ │ │ └─ namePath: IERC20
- │ │ └─ libraryName: SafeERC20
- │ ├─ 2
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: address
- │ │ │ ├─ name: usdcToken
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 3
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: address
- │ │ │ ├─ name: okgToken
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 4
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: address
- │ │ │ ├─ name: wallet
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 5
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: rate
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 6
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: openingTime
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 7
- │ │ ├─ type: StateVariableDeclaration
- │ │ ├─ variables
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: closingTime
- │ │ │ ├─ expression
- │ │ │ ├─ visibility: default
- │ │ │ ├─ isStateVar: true
- │ │ │ ├─ isDeclaredConst: false
- │ │ │ └─ isIndexed: false
- │ │ └─ initialValue
- │ ├─ 8
- │ │ ├─ type: ModifierDefinition
- │ │ ├─ name: saleOver
- │ │ ├─ parameters
- │ │ └─ body
- │ │ ├─ type: Block
- │ │ └─ statements
- │ │ ├─ 0
- │ │ │ ├─ type: ExpressionStatement
- │ │ │ └─ expression
- │ │ │ ├─ type: FunctionCall
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: require
- │ │ │ ├─ arguments
- │ │ │ │ ├─ 0
- │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ ├─ operator: >
- │ │ │ │ │ ├─ left
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: now
- │ │ │ │ │ └─ right
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: closingTime
- │ │ │ │ └─ 1
- │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ └─ value: Sale is running!
- │ │ │ └─ names
- │ │ └─ 1
- │ │ ├─ type: ExpressionStatement
- │ │ └─ expression
- │ │ ├─ type: Identifier
- │ │ └─ name: _
- │ ├─ 9
- │ │ ├─ type: EventDefinition
- │ │ ├─ name: TokenPurchased
- │ │ ├─ parameters
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: address
- │ │ │ │ ├─ name: buyer
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: true
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: uint256
- │ │ │ │ ├─ name: amount
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: true
- │ │ │ └─ 2
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: value
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: true
- │ │ └─ isAnonymous: false
- │ ├─ 10
- │ │ ├─ type: EventDefinition
- │ │ ├─ name: TokensRefunded
- │ │ ├─ parameters
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: address
- │ │ │ │ ├─ name: wallet
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: true
- │ │ │ └─ 1
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: amount
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: true
- │ │ └─ isAnonymous: false
- │ ├─ 11
- │ │ ├─ type: FunctionDefinition
- │ │ ├─ name
- │ │ ├─ parameters
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: uint256
- │ │ │ │ ├─ name: _rate
- │ │ │ │ ├─ storageLocation
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: false
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: uint256
- │ │ │ │ ├─ name: _duration
- │ │ │ │ ├─ storageLocation
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: false
- │ │ │ ├─ 2
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: address
- │ │ │ │ ├─ name: _usdc
- │ │ │ │ ├─ storageLocation
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: false
- │ │ │ ├─ 3
- │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ ├─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: address
- │ │ │ │ ├─ name: _okg
- │ │ │ │ ├─ storageLocation
- │ │ │ │ ├─ isStateVar: false
- │ │ │ │ └─ isIndexed: false
- │ │ │ └─ 4
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: address
- │ │ │ ├─ name: _wallet
- │ │ │ ├─ storageLocation
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: false
- │ │ ├─ body
- │ │ │ ├─ type: Block
- │ │ │ └─ statements
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: !=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: _usdc
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: USDC token address can not be zero
- │ │ │ │ └─ names
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: !=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: _okg
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: OKG token address can not be zero
- │ │ │ │ └─ names
- │ │ │ ├─ 2
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: >
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: _duration
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: Duration for sale must be greater than 0
- │ │ │ │ └─ names
- │ │ │ ├─ 3
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: >
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: _rate
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: sale rate can not be zero
- │ │ │ │ └─ names
- │ │ │ ├─ 4
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: !=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: _wallet
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: Wallet address can not be zero
- │ │ │ │ └─ names
- │ │ │ ├─ 5
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ ├─ operator: =
- │ │ │ │ ├─ left
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: usdcToken
- │ │ │ │ └─ right
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: _usdc
- │ │ │ ├─ 6
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ ├─ operator: =
- │ │ │ │ ├─ left
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: okgToken
- │ │ │ │ └─ right
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: _okg
- │ │ │ ├─ 7
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ ├─ operator: =
- │ │ │ │ ├─ left
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: rate
- │ │ │ │ └─ right
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: _rate
- │ │ │ │ │ └─ memberName: mul
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ ├─ operator: **
- │ │ │ │ │ ├─ left
- │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ ├─ number: 10
- │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ └─ right
- │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ ├─ number: 12
- │ │ │ │ │ └─ subdenomination
- │ │ │ │ └─ names
- │ │ │ ├─ 8
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ ├─ operator: =
- │ │ │ │ ├─ left
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: openingTime
- │ │ │ │ └─ right
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: now
- │ │ │ ├─ 9
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ ├─ operator: =
- │ │ │ │ ├─ left
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: closingTime
- │ │ │ │ └─ right
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: openingTime
- │ │ │ │ │ └─ memberName: add
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: _duration
- │ │ │ │ └─ names
- │ │ │ └─ 10
- │ │ │ ├─ type: ExpressionStatement
- │ │ │ └─ expression
- │ │ │ ├─ type: BinaryOperation
- │ │ │ ├─ operator: =
- │ │ │ ├─ left
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: wallet
- │ │ │ └─ right
- │ │ │ ├─ type: Identifier
- │ │ │ └─ name: _wallet
- │ │ ├─ visibility: public
- │ │ ├─ modifiers
- │ │ ├─ isConstructor: true
- │ │ └─ stateMutability
- │ ├─ 12
- │ │ ├─ type: FunctionDefinition
- │ │ ├─ name: buyTokens
- │ │ ├─ parameters
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: tokenPurchase
- │ │ │ ├─ storageLocation
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: false
- │ │ ├─ returnParameters
- │ │ ├─ body
- │ │ │ ├─ type: Block
- │ │ │ └─ statements
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: <=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: now
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: closingTime
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: The sale has ended
- │ │ │ │ └─ names
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: ==
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ │ │ └─ name: tokenPurchase
- │ │ │ │ │ │ │ │ └─ memberName: mod
- │ │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ │ └─ name: rate
- │ │ │ │ │ │ │ └─ names
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: NumberLiteral
- │ │ │ │ │ │ ├─ number: 0
- │ │ │ │ │ │ └─ subdenomination
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: Purchase amount should be a multiple of rate
- │ │ │ │ └─ names
- │ │ │ ├─ 2
- │ │ │ │ ├─ type: VariableDeclarationStatement
- │ │ │ │ ├─ variables
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ │ ├─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: uint256
- │ │ │ │ │ ├─ name: balance
- │ │ │ │ │ ├─ storageLocation
- │ │ │ │ │ ├─ isStateVar: false
- │ │ │ │ │ └─ isIndexed: false
- │ │ │ │ └─ initialValue
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: IERC20
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: okgToken
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ memberName: balanceOf
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: this
- │ │ │ │ │ └─ names
- │ │ │ │ └─ names
- │ │ │ ├─ 3
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: <=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: tokenPurchase
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: balance
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: Sufficient token not available for purchase
- │ │ │ │ └─ names
- │ │ │ ├─ 4
- │ │ │ │ ├─ type: VariableDeclarationStatement
- │ │ │ │ ├─ variables
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ │ ├─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: uint256
- │ │ │ │ │ ├─ name: value
- │ │ │ │ │ ├─ storageLocation
- │ │ │ │ │ ├─ isStateVar: false
- │ │ │ │ │ └─ isIndexed: false
- │ │ │ │ └─ initialValue
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: getPrice
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: tokenPurchase
- │ │ │ │ └─ names
- │ │ │ ├─ 5
- │ │ │ │ ├─ type: VariableDeclarationStatement
- │ │ │ │ ├─ variables
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ │ ├─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: uint256
- │ │ │ │ │ ├─ name: allowed
- │ │ │ │ │ ├─ storageLocation
- │ │ │ │ │ ├─ isStateVar: false
- │ │ │ │ │ └─ isIndexed: false
- │ │ │ │ └─ initialValue
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: IERC20
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: usdcToken
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ memberName: allowance
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: msg
- │ │ │ │ │ │ └─ memberName: sender
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: this
- │ │ │ │ │ └─ names
- │ │ │ │ └─ names
- │ │ │ ├─ 6
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: require
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: BinaryOperation
- │ │ │ │ │ │ ├─ operator: >=
- │ │ │ │ │ │ ├─ left
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: allowed
- │ │ │ │ │ │ └─ right
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: value
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: StringLiteral
- │ │ │ │ │ └─ value: not enough allowance provided by buyer
- │ │ │ │ └─ names
- │ │ │ ├─ 7
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: receiveTokens
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: value
- │ │ │ │ └─ names
- │ │ │ ├─ 8
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: sendTokens
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: tokenPurchase
- │ │ │ │ └─ names
- │ │ │ └─ 9
- │ │ │ ├─ type: EmitStatement
- │ │ │ └─ eventCall
- │ │ │ ├─ type: FunctionCall
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: TokenPurchased
- │ │ │ ├─ arguments
- │ │ │ │ ├─ 0
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: msg
- │ │ │ │ │ └─ memberName: sender
- │ │ │ │ ├─ 1
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: tokenPurchase
- │ │ │ │ └─ 2
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: value
- │ │ │ └─ names
- │ │ ├─ visibility: public
- │ │ ├─ modifiers
- │ │ │ └─ 0
- │ │ │ ├─ type: ModifierInvocation
- │ │ │ ├─ name: onlyWhitelisted
- │ │ │ └─ arguments
- │ │ ├─ isConstructor: false
- │ │ └─ stateMutability
- │ ├─ 13
- │ │ ├─ type: FunctionDefinition
- │ │ ├─ name: getPrice
- │ │ ├─ parameters
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: amount
- │ │ │ ├─ storageLocation
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: false
- │ │ ├─ returnParameters
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name
- │ │ │ ├─ storageLocation
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: false
- │ │ ├─ body
- │ │ │ ├─ type: Block
- │ │ │ └─ statements
- │ │ │ └─ 0
- │ │ │ ├─ type: ReturnStatement
- │ │ │ └─ expression
- │ │ │ ├─ type: FunctionCall
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: amount
- │ │ │ │ └─ memberName: div
- │ │ │ ├─ arguments
- │ │ │ │ └─ 0
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: rate
- │ │ │ └─ names
- │ │ ├─ visibility: public
- │ │ ├─ modifiers
- │ │ ├─ isConstructor: false
- │ │ └─ stateMutability: view
- │ ├─ 14
- │ │ ├─ type: FunctionDefinition
- │ │ ├─ name: refundTokens
- │ │ ├─ parameters
- │ │ ├─ returnParameters
- │ │ ├─ body
- │ │ │ ├─ type: Block
- │ │ │ └─ statements
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: VariableDeclarationStatement
- │ │ │ │ ├─ variables
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: VariableDeclaration
- │ │ │ │ │ ├─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: uint256
- │ │ │ │ │ ├─ name: balance
- │ │ │ │ │ ├─ storageLocation
- │ │ │ │ │ ├─ isStateVar: false
- │ │ │ │ │ └─ isIndexed: false
- │ │ │ │ └─ initialValue
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: IERC20
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: okgToken
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ memberName: balanceOf
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ │ └─ typeName
- │ │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ │ └─ name: address
- │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: this
- │ │ │ │ │ └─ names
- │ │ │ │ └─ names
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: ExpressionStatement
- │ │ │ │ └─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: IERC20
- │ │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ │ └─ name: okgToken
- │ │ │ │ │ │ └─ names
- │ │ │ │ │ └─ memberName: safeTransfer
- │ │ │ │ ├─ arguments
- │ │ │ │ │ ├─ 0
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: wallet
- │ │ │ │ │ └─ 1
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: balance
- │ │ │ │ └─ names
- │ │ │ └─ 2
- │ │ │ ├─ type: EmitStatement
- │ │ │ └─ eventCall
- │ │ │ ├─ type: FunctionCall
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: TokensRefunded
- │ │ │ ├─ arguments
- │ │ │ │ ├─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: wallet
- │ │ │ │ └─ 1
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: balance
- │ │ │ └─ names
- │ │ ├─ visibility: public
- │ │ ├─ modifiers
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: ModifierInvocation
- │ │ │ │ ├─ name: onlyOwner
- │ │ │ │ └─ arguments
- │ │ │ └─ 1
- │ │ │ ├─ type: ModifierInvocation
- │ │ │ ├─ name: saleOver
- │ │ │ └─ arguments
- │ │ ├─ isConstructor: false
- │ │ └─ stateMutability
- │ ├─ 15
- │ │ ├─ type: FunctionDefinition
- │ │ ├─ name: sendTokens
- │ │ ├─ parameters
- │ │ │ └─ 0
- │ │ │ ├─ type: VariableDeclaration
- │ │ │ ├─ typeName
- │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ └─ name: uint256
- │ │ │ ├─ name: amount
- │ │ │ ├─ storageLocation
- │ │ │ ├─ isStateVar: false
- │ │ │ └─ isIndexed: false
- │ │ ├─ returnParameters
- │ │ ├─ body
- │ │ │ ├─ type: Block
- │ │ │ └─ statements
- │ │ │ └─ 0
- │ │ │ ├─ type: ExpressionStatement
- │ │ │ └─ expression
- │ │ │ ├─ type: FunctionCall
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: IERC20
- │ │ │ │ │ ├─ arguments
- │ │ │ │ │ │ └─ 0
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: okgToken
- │ │ │ │ │ └─ names
- │ │ │ │ └─ memberName: safeTransfer
- │ │ │ ├─ arguments
- │ │ │ │ ├─ 0
- │ │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ │ ├─ expression
- │ │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ │ └─ name: msg
- │ │ │ │ │ └─ memberName: sender
- │ │ │ │ └─ 1
- │ │ │ │ ├─ type: Identifier
- │ │ │ │ └─ name: amount
- │ │ │ └─ names
- │ │ ├─ visibility: private
- │ │ ├─ modifiers
- │ │ ├─ isConstructor: false
- │ │ └─ stateMutability
- │ └─ 16
- │ ├─ type: FunctionDefinition
- │ ├─ name: receiveTokens
- │ ├─ parameters
- │ │ └─ 0
- │ │ ├─ type: VariableDeclaration
- │ │ ├─ typeName
- │ │ │ ├─ type: ElementaryTypeName
- │ │ │ └─ name: uint256
- │ │ ├─ name: price
- │ │ ├─ storageLocation
- │ │ ├─ isStateVar: false
- │ │ └─ isIndexed: false
- │ ├─ returnParameters
- │ ├─ body
- │ │ ├─ type: Block
- │ │ └─ statements
- │ │ └─ 0
- │ │ ├─ type: ExpressionStatement
- │ │ └─ expression
- │ │ ├─ type: FunctionCall
- │ │ ├─ expression
- │ │ │ ├─ type: MemberAccess
- │ │ │ ├─ expression
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: IERC20
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: usdcToken
- │ │ │ │ └─ names
- │ │ │ └─ memberName: safeTransferFrom
- │ │ ├─ arguments
- │ │ │ ├─ 0
- │ │ │ │ ├─ type: MemberAccess
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: msg
- │ │ │ │ └─ memberName: sender
- │ │ │ ├─ 1
- │ │ │ │ ├─ type: FunctionCall
- │ │ │ │ ├─ expression
- │ │ │ │ │ ├─ type: ElementaryTypeNameExpression
- │ │ │ │ │ └─ typeName
- │ │ │ │ │ ├─ type: ElementaryTypeName
- │ │ │ │ │ └─ name: address
- │ │ │ │ ├─ arguments
- │ │ │ │ │ └─ 0
- │ │ │ │ │ ├─ type: Identifier
- │ │ │ │ │ └─ name: wallet
- │ │ │ │ └─ names
- │ │ │ └─ 2
- │ │ │ ├─ type: Identifier
- │ │ │ └─ name: price
- │ │ └─ names
- │ ├─ visibility: private
- │ ├─ modifiers
- │ ├─ isConstructor: false
- │ └─ stateMutability
- └─ kind: contract
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement