@gooddollar/goodcontracts
Version:
GoodDollar Contracts
1,360 lines • 266 kB
JSON
{
"contractName": "UBIScheme",
"abi": [
{
"inputs": [],
"name": "currentDay",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"currentDay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/Interfaces.sol\":\"UBIScheme\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/Interfaces.sol\":{\"keccak256\":\"0xe501727b0e5e15fe639129ab4b1abc59a14ebd3ddd05bb7056ac4fc26a8f3ee7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://90d8797740cfd3933ae849f3144e30f9133a55b26634b3efefa8206cd91f62d8\",\"dweb:/ipfs/QmYLeetoyiPej9acnGzjLLwgVnEg4d2Eg1Xb4k3A1mJqj6\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6;\n\npragma experimental ABIEncoderV2;\n\ninterface cERC20 {\n\tfunction mint(uint256 mintAmount) external returns (uint256);\n\n\tfunction redeemUnderlying(uint256 mintAmount) external returns (uint256);\n\n\tfunction exchangeRateCurrent() external returns (uint256);\n\n\tfunction exchangeRateStored() external view returns (uint256);\n\n\tfunction balanceOf(address addr) external view returns (uint256);\n\n\tfunction transfer(address to, uint256 amount) external returns (bool);\n\n\tfunction approve(address spender, uint256 amount) external returns (bool);\n}\n\ninterface GoodDollar is cERC20 {\n\tfunction getFees(uint256 value) external view returns (uint256, bool);\n\n\tfunction mint(address to, uint256 mintAmount) external returns (uint256);\n}\n\ninterface Staking {\n\tstruct Staker {\n\t\t// The staked DAI amount\n\t\tuint256 stakedDAI;\n\t\t// The latest block number which the\n\t\t// staker has staked tokens\n\t\tuint256 lastStake;\n\t}\n\n\tfunction stakeDAI(uint256 amount) external;\n\n\tfunction withdrawStake() external;\n\n\tfunction stakers(address staker) external view returns (Staker memory);\n}\n\ninterface Uniswap {\n\tfunction swapExactETHForTokens(\n\t\tuint256 amountOutMin,\n\t\taddress[] calldata path,\n\t\taddress to,\n\t\tuint256 deadline\n\t) external payable returns (uint256[] memory amounts);\n\n\tfunction swapExactTokensForETH(\n\t\tuint256 amountIn,\n\t\tuint256 amountOutMin,\n\t\taddress[] calldata path,\n\t\taddress to,\n\t\tuint256 deadline\n\t) external returns (uint256[] memory amounts);\n\n\tfunction swapExactTokensForTokens(\n\t\tuint256 amountIn,\n\t\tuint256 amountOutMin,\n\t\taddress[] calldata path,\n\t\taddress to,\n\t\tuint256 deadline\n\t) external returns (uint256[] memory amounts);\n\n\tfunction WETH() external pure returns (address);\n\n\tfunction factory() external pure returns (address);\n\n\tfunction quote(\n\t\tuint256 amountA,\n\t\tuint256 reserveA,\n\t\tuint256 reserveB\n\t) external pure returns (uint256 amountB);\n\n\tfunction getAmountIn(\n\t\tuint256 amountOut,\n\t\tuint256 reserveIn,\n\t\tuint256 reserveOut\n\t) external pure returns (uint256 amountIn);\n\n\tfunction getAmountOut(\n\t\tuint256 amountI,\n\t\tuint256 reserveIn,\n\t\tuint256 reserveOut\n\t) external pure returns (uint256 amountOut);\n}\n\ninterface UniswapFactory {\n\tfunction getPair(address tokenA, address tokenB)\n\t\texternal\n\t\tview\n\t\treturns (address);\n}\n\ninterface UniswapPair {\n\tfunction getReserves()\n\t\texternal\n\t\tview\n\t\treturns (\n\t\t\tuint112 reserve0,\n\t\t\tuint112 reserve1,\n\t\t\tuint32 blockTimestampLast\n\t\t);\n\n\tfunction kLast() external view returns (uint256);\n}\n\ninterface Reserve {\n\tfunction buy(\n\t\taddress _buyWith,\n\t\tuint256 _tokenAmount,\n\t\tuint256 _minReturn\n\t) external returns (uint256);\n}\n\ninterface IIdentity {\n\tfunction isWhitelisted(address user) external view returns (bool);\n\n\tfunction addWhitelistedWithDID(address account, string memory did) external;\n\n\tfunction removeWhitelisted(address account) external;\n\n\tfunction addIdentityAdmin(address account) external returns (bool);\n\n\tfunction setAvatar(address _avatar) external;\n}\n\ninterface UBIScheme {\n\tfunction currentDay() external view returns (uint256);\n}\n\ninterface ProxyAdmin {\n\tfunction getProxyImplementation(address proxy)\n\t\texternal\n\t\tview\n\t\treturns (address);\n\n\tfunction getProxyAdmin(address proxy) external view returns (address);\n\n\tfunction upgrade(address proxy, address implementation) external;\n\n\tfunction owner() external view returns (address);\n\n\tfunction transferOwnership(address newOwner) external;\n}\n",
"sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/Interfaces.sol",
"ast": {
"absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/Interfaces.sol",
"exportedSymbols": {
"GoodDollar": [
330
],
"IIdentity": [
513
],
"ProxyAdmin": [
551
],
"Reserve": [
481
],
"Staking": [
351
],
"UBIScheme": [
519
],
"Uniswap": [
444
],
"UniswapFactory": [
454
],
"UniswapPair": [
469
],
"cERC20": [
309
]
},
"id": 552,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 258,
"literals": [
"solidity",
">=",
"0.6"
],
"nodeType": "PragmaDirective",
"src": "33:22:1"
},
{
"id": 259,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "57:33:1"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 309,
"linearizedBaseContracts": [
309
],
"name": "cERC20",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "a0712d68",
"id": 266,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "mint",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 262,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 261,
"mutability": "mutable",
"name": "mintAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 266,
"src": "126:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 260,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "126:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "125:20:1"
},
"returnParameters": {
"id": 265,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 264,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 266,
"src": "164:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 263,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "164:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "163:9:1"
},
"scope": 309,
"src": "112:61:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "852a12e3",
"id": 273,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "redeemUnderlying",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 269,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 268,
"mutability": "mutable",
"name": "mintAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 273,
"src": "202:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 267,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "202:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "201:20:1"
},
"returnParameters": {
"id": 272,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 271,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 273,
"src": "240:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 270,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "240:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "239:9:1"
},
"scope": 309,
"src": "176:73:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "bd6d894d",
"id": 278,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "exchangeRateCurrent",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 274,
"nodeType": "ParameterList",
"parameters": [],
"src": "280:2:1"
},
"returnParameters": {
"id": 277,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 276,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 278,
"src": "301:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 275,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "301:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "300:9:1"
},
"scope": 309,
"src": "252:58:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "182df0f5",
"id": 283,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "exchangeRateStored",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 279,
"nodeType": "ParameterList",
"parameters": [],
"src": "340:2:1"
},
"returnParameters": {
"id": 282,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 281,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 283,
"src": "366:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 280,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "366:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "365:9:1"
},
"scope": 309,
"src": "313:62:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "70a08231",
"id": 290,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "balanceOf",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 286,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 285,
"mutability": "mutable",
"name": "addr",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 290,
"src": "397:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 284,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "397:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "396:14:1"
},
"returnParameters": {
"id": 289,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 288,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 290,
"src": "434:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 287,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "434:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "433:9:1"
},
"scope": 309,
"src": "378:65:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "a9059cbb",
"id": 299,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transfer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 295,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 292,
"mutability": "mutable",
"name": "to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 299,
"src": "464:10:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 291,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "464:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 294,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 299,
"src": "476:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 293,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "476:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "463:28:1"
},
"returnParameters": {
"id": 298,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 297,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 299,
"src": "510:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 296,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "510:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "509:6:1"
},
"scope": 309,
"src": "446:70:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "095ea7b3",
"id": 308,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "approve",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 304,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 301,
"mutability": "mutable",
"name": "spender",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 308,
"src": "536:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 300,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "536:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 303,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 308,
"src": "553:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 302,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "553:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "535:33:1"
},
"returnParameters": {
"id": 307,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 306,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 308,
"src": "587:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 305,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "587:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "586:6:1"
},
"scope": 309,
"src": "519:74:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 552,
"src": "92:503:1"
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 310,
"name": "cERC20",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 309,
"src": "621:6:1",
"typeDescriptions": {
"typeIdentifier": "t_contract$_cERC20_$309",
"typeString": "contract cERC20"
}
},
"id": 311,
"nodeType": "InheritanceSpecifier",
"src": "621:6:1"
}
],
"contractDependencies": [
309
],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 330,
"linearizedBaseContracts": [
330,
309
],
"name": "GoodDollar",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "d5a06d4c",
"id": 320,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getFees",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 314,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 313,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 320,
"src": "648:13:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 312,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "648:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "647:15:1"
},
"returnParameters": {
"id": 319,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 316,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 320,
"src": "686:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 315,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "686:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 318,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 320,
"src": "695:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 317,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "695:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "685:15:1"
},
"scope": 330,
"src": "631:70:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "40c10f19",
"id": 329,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "mint",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 325,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 322,
"mutability": "mutable",
"name": "to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 329,
"src": "718:10:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 321,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "718:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 324,
"mutability": "mutable",
"name": "mintAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 329,
"src": "730:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 323,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "730:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "717:32:1"
},
"returnParameters": {
"id": 328,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 327,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 329,
"src": "768:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 326,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "768:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "767:9:1"
},
"scope": 330,
"src": "704:73:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 552,
"src": "597:182:1"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 351,
"linearizedBaseContracts": [
351
],
"name": "Staking",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Staking.Staker",
"id": 335,
"members": [
{
"constant": false,
"id": 332,
"mutability": "mutable",
"name": "stakedDAI",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 335,
"src": "847:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 331,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "847:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 334,
"mutability": "mutable",
"name": "lastStake",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 335,
"src": "937:17:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 333,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "937:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Staker",
"nodeType": "StructDefinition",
"scope": 351,
"src": "802:156:1",
"visibility": "public"
},
{
"body": null,
"documentation": null,
"functionSelector": "64aab239",
"id": 340,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "stakeDAI",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 338,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 337,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 340,
"src": "979:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 336,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "979:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "978:16:1"
},
"returnParameters": {
"id": 339,
"nodeType": "ParameterList",
"parameters": [],
"src": "1003:0:1"
},
"scope": 351,
"src": "961:43:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "bed9d861",
"id": 343,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "withdrawStake",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 341,
"nodeType": "ParameterList",
"parameters": [],
"src": "1029:2:1"
},
"returnParameters": {
"id": 342,
"nodeType": "ParameterList",
"parameters": [],
"src": "1040:0:1"
},
"scope": 351,
"src": "1007:34:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"functionSelector": "9168ae72",
"id": 350,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "stakers",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 346,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 345,
"mutability": "mutable",
"name": "staker",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 350,
"src": "1061:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 344,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1061:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1060:16:1"
},
"returnParameters": {
"id": 349,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 348,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 350,
"src": "1100:13:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Staker_$335_memory_ptr",
"typeString": "struct Staking.Staker"
},
"typeName": {
"contractScope": null,
"id": 347,
"name": "Staker",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 335,
"src": "1100:6:1",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Staker_$335_storage_ptr",
"typeString": "struct Staking.Staker"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1099:15:1"
},
"scope": 351,
"src": "1044:71:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 552,
"src": "781:336:1"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 444,
"linearizedBaseContracts": [
444
],
"name": "Uniswap",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "7ff36ab5",
"id": 366,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "swapExactETHForTokens",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 361,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 353,
"mutability": "mutable",
"name": "amountOutMin",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 366,
"src": "1174:20:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 352,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1174:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 356,
"mutability": "mutable",
"name": "path",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 366,
"src": "1198:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 354,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1198:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 355,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1198:9:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 358,
"mutability": "mutable",
"name": "to",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 366,
"src": "1225:10:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 357,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1225:7:1",
"stateM