Feature/add predictoor pause event (#723)
* bump contracts * add pause for predictoorContract
This commit is contained in:
parent
f9dee6c59f
commit
ef9da87558
File diff suppressed because it is too large
Load Diff
|
@ -75,7 +75,7 @@
|
|||
"typescript": "^5.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^2.0.0-next.11",
|
||||
"@oceanprotocol/contracts": "^2.0.0-next.12",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.6",
|
||||
"ethereumjs-util": "^7.1.5"
|
||||
|
|
|
@ -757,6 +757,7 @@ type PredictContract @entity{
|
|||
"id = {contract address}"
|
||||
id: ID!
|
||||
token: Token!
|
||||
paused: Boolean!
|
||||
slots: [PredictSlot!] @derivedFrom(field: "predictContract")
|
||||
settingUpdates: [PredictSettingUpdate!] @derivedFrom(field: "predictContract")
|
||||
subscriptions: [PredictSubscription!] @derivedFrom(field: "predictContract")
|
||||
|
|
|
@ -15,7 +15,8 @@ import {
|
|||
NewSubscription,
|
||||
TruevalSubmitted,
|
||||
SettingChanged,
|
||||
RevenueAdded
|
||||
RevenueAdded,
|
||||
Paused
|
||||
} from '../@types/templates/ERC20Template3/ERC20Template3'
|
||||
|
||||
import { weiToDecimal } from './utils/generic'
|
||||
|
@ -209,6 +210,12 @@ export function handleSettingChanged(event: SettingChanged): void {
|
|||
predictSettingsUpdate.save()
|
||||
}
|
||||
|
||||
export function handlePaused(event: Paused): void {
|
||||
const predictContract = getPredictContract(event.address)
|
||||
predictContract.paused = event.params.paused
|
||||
predictContract.save()
|
||||
}
|
||||
|
||||
export function handleRevenueAdded(event: RevenueAdded): void {
|
||||
/*
|
||||
for (uint256 i = 0; i < num_epochs; i++) {
|
||||
|
|
|
@ -142,6 +142,7 @@ export function createPredictContract(address: Address): PredictContract {
|
|||
predictContract.timestamp = 0
|
||||
predictContract.block = 0
|
||||
predictContract.eventIndex = 0
|
||||
predictContract.paused = false
|
||||
predictContract.save()
|
||||
return predictContract
|
||||
}
|
||||
|
|
|
@ -86,6 +86,8 @@ templates:
|
|||
handler: handleSettingChanged
|
||||
- event: RevenueAdded(uint256,uint256,uint256,uint256,uint256)
|
||||
handler: handleRevenueAdded
|
||||
- event: Paused(bool)
|
||||
handler: handlePaused
|
||||
|
||||
- name: ERC721Template
|
||||
kind: ethereum/contract
|
||||
|
|
Loading…
Reference in New Issue