Proposing Programmatically
Proposing and disputing ManagedOptimisticOracleV2 requests is largely the same as OptimisticOracleV2 requests with the following differences:
Adding the ManagedOptimisticOracleV2 Addresses
Programmatic proposers and disputers will be used to listening for OptimisticOracleV2 events and sending proposing and disputing transactions to these addresses. To add support to new ManagedOptimisticOracleV2 deployments, programmatic proposers and disputers will have to add these new deployment addresses to their bot configs.
Note: the first ManagedOptimisticOracleV2 deployment is managed by Polymarket and can be found here.
Viewing a Request's Proposer Whitelist
ManagedOptimisticOracleV2 requests have defined proposer whitelists. The whitelist for a given request can be found by calling the getProposerWhitelistWithEnforcementStatus
function with the request's requester
, identifier
, and ancillaryData
. The function will return an isEnforced
boolean that defines whether a whitelist is enforced and an address array of allowedProposers
. If isEnforced
is true, then only allowedProposers
may propose the request. If isEnforced
is false, any address will be able to propose.
When a new request is created on ManagedOptimisticOracleV2 it will default to the defaultProposerWhitelist
unless overridden by the requestManager
. This default whitelist can be viewed with the following steps:
Call the
defaultProposerWhitelist
view function on a deployed ManagedOptimisticOracleV2 contract to get the address of the default whitelist.Call
getWhitelist
on the default whitelist address to view all address on the whitelist. Alternatively, callisOnWhitelist
to check if a given address is on the whitelist.
Proposing on ManagedOptimisticOracleV2
Proposing on ManagedOptimisticOracleV2 can be done by calling the same proposePrice
or proposePriceFor
functions with the same arguments as proposing on OptimisticOracleV2. Proposal transactions from addresses that are not whitelisted will revert with the following error messages, "Sender not whitelisted"
or, "Proposer not whitelisted"
.
Last updated
Was this helpful?