Skip to main content

ResourceManager

Git Source

Inherits: IResourceManager, Owned

A contract that holds immutable state for the resource token and the resource recipient address. It also maintains logic for managing the threshold of the resource token.

State Variables

threshold

The minimum threshold of RESOURCE tokens required to perform a release

uint256 public threshold

thresholdSetter

The address authorized to set the threshold value

address public thresholdSetter

RESOURCE

The resource token required by parent IReleaser

ERC20 public immutable RESOURCE

RESOURCE_RECIPIENT

The recipient of the RESOURCE tokens

address public immutable RESOURCE_RECIPIENT

Functions

onlyThresholdSetter

Ensures only the threshold setter can call the setThreshold function

modifier onlyThresholdSetter() ;

constructor

At construction the thresholdSetter defaults to 0 and its on the owner to set.

constructor(address _resource, uint256 _threshold, address _owner, address _recipient)
Owned(_owner);

setThresholdSetter

Set the address authorized to set the threshold value

only callable by owner

function setThresholdSetter(address _thresholdSetter) external onlyOwner;

setThreshold

Set the minimum threshold of RESOURCE tokens required to perform a release

only callable by thresholdSetter the thresholdSetter should take explicit care when updating the threshold

  • lowering the threshold may create instantaneous value leakage
  • front-running a release with an increased threshold may cause economic loss to the releaser/searcher
function setThreshold(uint256 _threshold) external onlyThresholdSetter;