@etherisc/registry-contracts
Version:
Etherisc's smart contracts for the registry.
1,574 lines • 399 kB
JSON
{
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "UFixed",
"name": "oldRewardRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "UFixed",
"name": "newRewardRate",
"type": "uint256"
}
],
"name": "LogDefaultRewardRateSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "NftId",
"name": "target",
"type": "uint96"
},
{
"indexed": false,
"internalType": "UFixed",
"name": "oldRewardRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "UFixed",
"name": "newRewardRate",
"type": "uint256"
}
],
"name": "LogTargetRewardRateSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "EXP",
"outputs": [
{
"internalType": "int8",
"name": "",
"type": "int8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_REWARD_RATE_EXP",
"outputs": [
{
"internalType": "int8",
"name": "",
"type": "int8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_REWARD_RATE_VALUE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER_HALF",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ROUNDING_DEFAULT",
"outputs": [
{
"internalType": "enum UFixedType.Rounding",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "YEAR_DURATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"internalType": "UFixed",
"name": "rate",
"type": "uint256"
}
],
"name": "calculateRewards",
"outputs": [
{
"internalType": "uint256",
"name": "rewardAmount",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed",
"name": "a",
"type": "uint256"
},
{
"internalType": "enum UFixedType.Rounding",
"name": "rounding",
"type": "uint8"
}
],
"name": "ftoi",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed",
"name": "a",
"type": "uint256"
}
],
"name": "ftoi",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "NftId",
"name": "target",
"type": "uint96"
}
],
"name": "getTargetRewardRate",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "a",
"type": "uint256"
}
],
"name": "itof",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "a",
"type": "uint256"
},
{
"internalType": "int8",
"name": "exp",
"type": "int8"
}
],
"name": "itof",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "maxRewardRate",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "rewardRate",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed",
"name": "newRewardRate",
"type": "uint256"
}
],
"name": "setRewardRate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "NftId",
"name": "target",
"type": "uint96"
},
{
"internalType": "UFixed",
"name": "newRewardRate",
"type": "uint256"
}
],
"name": "setTargetRewardRate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"allSourcePaths": {
"23": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/Context.sol",
"34": "contracts/registry/IChainNft.sol",
"43": "contracts/shared/IBaseTypes.sol",
"47": "contracts/shared/UFixedMath.sol",
"52": "contracts/staking/RewardHelper.sol",
"6": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/access/Ownable.sol"
},
"ast": {
"absolutePath": "contracts/staking/RewardHelper.sol",
"exportedSymbols": {
"NftId": [
3353
],
"Ownable": [
12623
],
"RewardHelper": [
6866
],
"Timestamp": [
4530
],
"UFixed": [
5099
],
"UFixedType": [
5591
],
"blockTimestamp": [
4700
],
"zeroTimestamp": [
4711
]
},
"id": 6867,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6591,
"literals": [
"solidity",
"^",
"0.8",
".19"
],
"nodeType": "PragmaDirective",
"src": "39:24:52"
},
{
"absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/access/Ownable.sol",
"file": "@openzeppelin/contracts/access/Ownable.sol",
"id": 6593,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 6867,
"sourceUnit": 12624,
"src": "65:67:52",
"symbolAliases": [
{
"foreign": {
"id": 6592,
"name": "Ownable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12623,
"src": "73:7:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "contracts/shared/IBaseTypes.sol",
"file": "../shared/IBaseTypes.sol",
"id": 6597,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 6867,
"sourceUnit": 4754,
"src": "134:82:52",
"symbolAliases": [
{
"foreign": {
"id": 6594,
"name": "Timestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4530,
"src": "142:9:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 6595,
"name": "blockTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4700,
"src": "153:14:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 6596,
"name": "zeroTimestamp",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4711,
"src": "169:13:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "contracts/shared/UFixedMath.sol",
"file": "../shared/UFixedMath.sol",
"id": 6600,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 6867,
"sourceUnit": 5592,
"src": "217:60:52",
"symbolAliases": [
{
"foreign": {
"id": 6598,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "225:6:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 6599,
"name": "UFixedType",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5591,
"src": "233:10:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"absolutePath": "contracts/registry/IChainNft.sol",
"file": "../registry/IChainNft.sol",
"id": 6602,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 6867,
"sourceUnit": 3495,
"src": "278:48:52",
"symbolAliases": [
{
"foreign": {
"id": 6601,
"name": "NftId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3353,
"src": "286:5:52",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 6603,
"name": "Ownable",
"nameLocations": [
"358:7:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 12623,
"src": "358:7:52"
},
"id": 6604,
"nodeType": "InheritanceSpecifier",
"src": "358:7:52"
},
{
"baseName": {
"id": 6605,
"name": "UFixedType",
"nameLocations": [
"371:10:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5591,
"src": "371:10:52"
},
"id": 6606,
"nodeType": "InheritanceSpecifier",
"src": "371:10:52"
}
],
"canonicalName": "RewardHelper",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 6866,
"linearizedBaseContracts": [
6866,
5591,
12623,
16878
],
"name": "RewardHelper",
"nameLocation": "338:12:52",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"functionSelector": "78a987ba",
"id": 6609,
"mutability": "constant",
"name": "MAX_REWARD_RATE_VALUE",
"nameLocation": "412:21:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "388:51:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6607,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "388:7:52",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"hexValue": "333333",
"id": 6608,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "436:3:52",
"typeDescriptions": {
"typeIdentifier": "t_rational_333_by_1",
"typeString": "int_const 333"
},
"value": "333"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "b38ea175",
"id": 6613,
"mutability": "constant",
"name": "MAX_REWARD_RATE_EXP",
"nameLocation": "466:19:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "445:45:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int8",
"typeString": "int8"
},
"typeName": {
"id": 6610,
"name": "int8",
"nodeType": "ElementaryTypeName",
"src": "445:4:52",
"typeDescriptions": {
"typeIdentifier": "t_int8",
"typeString": "int8"
}
},
"value": {
"id": 6612,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "488:2:52",
"subExpression": {
"hexValue": "33",
"id": 6611,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "489:1:52",
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"typeDescriptions": {
"typeIdentifier": "t_rational_minus_3_by_1",
"typeString": "int_const -3"
}
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "0dc0ba72",
"id": 6616,
"mutability": "constant",
"name": "YEAR_DURATION",
"nameLocation": "520:13:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "496:48:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6614,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "496:7:52",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"hexValue": "333635",
"id": 6615,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "536:8:52",
"subdenomination": "days",
"typeDescriptions": {
"typeIdentifier": "t_rational_31536000_by_1",
"typeString": "int_const 31536000"
},
"value": "365"
},
"visibility": "public"
},
{
"canonicalName": "RewardHelper.RewardInfo",
"id": 6626,
"members": [
{
"constant": false,
"id": 6619,
"mutability": "mutable",
"name": "rewardRate",
"nameLocation": "586:10:52",
"nodeType": "VariableDeclaration",
"scope": 6626,
"src": "579:17:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6618,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6617,
"name": "UFixed",
"nameLocations": [
"579:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "579:6:52"
},
"referencedDeclaration": 5099,
"src": "579:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6622,
"mutability": "mutable",
"name": "createdAt",
"nameLocation": "616:9:52",
"nodeType": "VariableDeclaration",
"scope": 6626,
"src": "606:19:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$4530",
"typeString": "Timestamp"
},
"typeName": {
"id": 6621,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6620,
"name": "Timestamp",
"nameLocations": [
"606:9:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 4530,
"src": "606:9:52"
},
"referencedDeclaration": 4530,
"src": "606:9:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$4530",
"typeString": "Timestamp"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6625,
"mutability": "mutable",
"name": "updatedAt",
"nameLocation": "645:9:52",
"nodeType": "VariableDeclaration",
"scope": 6626,
"src": "635:19:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$4530",
"typeString": "Timestamp"
},
"typeName": {
"id": 6624,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6623,
"name": "Timestamp",
"nameLocations": [
"635:9:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 4530,
"src": "635:9:52"
},
"referencedDeclaration": 4530,
"src": "635:9:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Timestamp_$4530",
"typeString": "Timestamp"
}
},
"visibility": "internal"
}
],
"name": "RewardInfo",
"nameLocation": "558:10:52",
"nodeType": "StructDefinition",
"scope": 6866,
"src": "551:110:52",
"visibility": "public"
},
{
"anonymous": false,
"eventSelector": "b3dadab54c4cf13d74f841f035ba6d7da492144b56ca32d1d0d340aeb2323fa7",
"id": 6639,
"name": "LogTargetRewardRateSet",
"nameLocation": "673:22:52",
"nodeType": "EventDefinition",
"parameters": {
"id": 6638,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6628,
"indexed": false,
"mutability": "mutable",
"name": "user",
"nameLocation": "713:4:52",
"nodeType": "VariableDeclaration",
"scope": 6639,
"src": "705:12:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6627,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "705:7:52",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6631,
"indexed": false,
"mutability": "mutable",
"name": "target",
"nameLocation": "733:6:52",
"nodeType": "VariableDeclaration",
"scope": 6639,
"src": "727:12:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_NftId_$3353",
"typeString": "NftId"
},
"typeName": {
"id": 6630,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6629,
"name": "NftId",
"nameLocations": [
"727:5:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 3353,
"src": "727:5:52"
},
"referencedDeclaration": 3353,
"src": "727:5:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_NftId_$3353",
"typeString": "NftId"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6634,
"indexed": false,
"mutability": "mutable",
"name": "oldRewardRate",
"nameLocation": "756:13:52",
"nodeType": "VariableDeclaration",
"scope": 6639,
"src": "749:20:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6633,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6632,
"name": "UFixed",
"nameLocations": [
"749:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "749:6:52"
},
"referencedDeclaration": 5099,
"src": "749:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6637,
"indexed": false,
"mutability": "mutable",
"name": "newRewardRate",
"nameLocation": "786:13:52",
"nodeType": "VariableDeclaration",
"scope": 6639,
"src": "779:20:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6636,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6635,
"name": "UFixed",
"nameLocations": [
"779:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "779:6:52"
},
"referencedDeclaration": 5099,
"src": "779:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "695:110:52"
},
"src": "667:139:52"
},
{
"anonymous": false,
"eventSelector": "ccfbe413ba62ff5ec59c9423134293d4731d2f2b29b72ed562c3846f2c4954e3",
"id": 6649,
"name": "LogDefaultRewardRateSet",
"nameLocation": "818:23:52",
"nodeType": "EventDefinition",
"parameters": {
"id": 6648,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6641,
"indexed": false,
"mutability": "mutable",
"name": "user",
"nameLocation": "859:4:52",
"nodeType": "VariableDeclaration",
"scope": 6649,
"src": "851:12:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6640,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "851:7:52",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6644,
"indexed": false,
"mutability": "mutable",
"name": "oldRewardRate",
"nameLocation": "880:13:52",
"nodeType": "VariableDeclaration",
"scope": 6649,
"src": "873:20:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6643,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6642,
"name": "UFixed",
"nameLocations": [
"873:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "873:6:52"
},
"referencedDeclaration": 5099,
"src": "873:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6647,
"indexed": false,
"mutability": "mutable",
"name": "newRewardRate",
"nameLocation": "910:13:52",
"nodeType": "VariableDeclaration",
"scope": 6649,
"src": "903:20:52",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6646,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6645,
"name": "UFixed",
"nameLocations": [
"903:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "903:6:52"
},
"referencedDeclaration": 5099,
"src": "903:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "841:88:52"
},
"src": "812:118:52"
},
{
"constant": false,
"id": 6655,
"mutability": "mutable",
"name": "_targetRewardRate",
"nameLocation": "1033:17:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "977:73:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_NftId_$3353_$_t_struct$_RewardInfo_$6626_storage_$",
"typeString": "mapping(NftId => struct RewardHelper.RewardInfo)"
},
"typeName": {
"id": 6654,
"keyName": "target",
"keyNameLocation": "991:6:52",
"keyType": {
"id": 6651,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6650,
"name": "NftId",
"nameLocations": [
"985:5:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 3353,
"src": "985:5:52"
},
"referencedDeclaration": 3353,
"src": "985:5:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_NftId_$3353",
"typeString": "NftId"
}
},
"nodeType": "Mapping",
"src": "977:46:52",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_NftId_$3353_$_t_struct$_RewardInfo_$6626_storage_$",
"typeString": "mapping(NftId => struct RewardHelper.RewardInfo)"
},
"valueName": "rewardRate",
"valueNameLocation": "1012:10:52",
"valueType": {
"id": 6653,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6652,
"name": "RewardInfo",
"nameLocations": [
"1001:10:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 6626,
"src": "1001:10:52"
},
"referencedDeclaration": 6626,
"src": "1001:10:52",
"typeDescriptions": {
"typeIdentifier": "t_struct$_RewardInfo_$6626_storage_ptr",
"typeString": "struct RewardHelper.RewardInfo"
}
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6658,
"mutability": "mutable",
"name": "_rewardRate",
"nameLocation": "1106:11:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "1090:27:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6657,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6656,
"name": "UFixed",
"nameLocations": [
"1090:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "1090:6:52"
},
"referencedDeclaration": 5099,
"src": "1090:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6661,
"mutability": "mutable",
"name": "_rewardRateMax",
"nameLocation": "1139:14:52",
"nodeType": "VariableDeclaration",
"scope": 6866,
"src": "1123:30:52",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 6660,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 6659,
"name": "UFixed",
"nameLocations": [
"1123:6:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "1123:6:52"
},
"referencedDeclaration": 5099,
"src": "1123:6:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"body": {
"id": 6673,
"nodeType": "Block",
"src": "1216:82:52",
"statements": [
{
"expression": {
"id": 6671,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 6666,
"name": "_rewardRateMax",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6661,
"src": "1226:14:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 6668,
"name": "MAX_REWARD_RATE_VALUE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6609,
"src": "1248:21:52",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"id": 6669,
"name": "MAX_REWARD_RATE_EXP",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6613,
"src": "1271:19:52",
"typeDescriptions": {
"typeIdentifier": "t_int8",
"typeString": "int8"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_int8",
"typeString": "int8"
}
],
"id": 6667,
"name": "itof",
"nodeType": "Identifier",
"overloadedDeclarations": [
5465,
5510
],
"referencedDeclaration": 5510,
"src": "1243:4:52",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_int8_$returns$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "function (uint256,int8) pure returns (UFixed)"
}
},
"id": 6670,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1243:48:52",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"src": "1226:65:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"id": 6672,
"nodeType": "ExpressionStatement",
"src": "1226:65:52"
}
]
},
"id": 6674,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [],
"id": 6664,
"kind": "baseConstructorSpecifier",
"modifierName": {
"id": 6663,
"name": "Ownable",
"nameLocations": [
"1206:7:52"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 12623,
"src": "1206:7:52"
},
"nodeType": "ModifierInvocation",
"src": "1206:9:52"
}
],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6662,
"nodeType": "ParameterList",
"parameters": [],
"src": "1203:2:52"
},
"returnParameters": {
"id": 6665,
"nodeType": "ParameterList",
"parameters": [],
"src": "1216:0:52"
},
"scope": 6866,
"src": "1192:106:52",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 6705,
"nodeType": "Block",
"src": "1389:256:52",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"function": 5330,
"id": 6685,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6683,
"name": "newRewardRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6677,
"src": "1407:13:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 6684,
"name": "_rewardRateMax",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6661,
"src": "1424:14:52",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"src": "1407:31:52",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4552524f523a5252482d3031303a5245574152445f455843454544535f4d41585f56414c5545",
"id": 6686,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1439:40:52",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_d50d0aa581018140e3878f551791fbf3a5e5bcca5553cb5f506444324029cde6",
"typeString": "literal_string \"ERROR:RRH-010:REWARD_EXCEEDS_MAX_VALUE\""
},
"value": "ERROR:RRH-010:REWARD_EXCEEDS_MAX_VALUE"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_d50d0aa581018140e3878f551791fbf3a5e5bcca5553cb5f506444324029cde6",
"typeString": "literal_string \"ERROR:RRH-010:REWARD_EXCEEDS_MAX_VALUE\""
}
],
"id": 6682,
"name