Function to call transmit_emissions an RootGauge _gauge. Mints and transmits emissions to sidechains/L2.
Input
Type
Description
_gauge
address
RootChainGauge Address
Info
transmit_emissions can also be called on the RootGauge itself.
Source code
@externaldeftransmit_emissions(_gauge:address):""" @notice Call `transmit_emissions` on a root gauge @dev Entrypoint for anycall to request emissions for a child gauge. The way that gauges work, this can also be called on the root chain without a request. """# in most cases this will return True# for special bridges *cough cough Multichain, we can only do# one bridge per tx, therefore this will verify msg.sender in [tx.origin, self.call_proxy]assertBridger(RootGauge(_gauge).bridger()).check(msg.sender)RootGauge(_gauge).transmit_emissions()
Getter for the RootChainLiquidityGauge implementation.
Returns: implementation (address).
Source code
get_implementation:public(address)@externaldefset_implementation(_implementation:address):""" @notice Set the implementation @param _implementation The address of the implementation to use """assertmsg.sender==self.owner# dev: only ownerlogUpdateImplementation(self.get_implementation,_implementation)self.get_implementation=_implementation
This function is only callable by the owner of the contract.
Function to set the RootGauge implementation.
Emits: UpdateImplementation
Input
Type
Description
_implementation
address
RootGauge Implementation
Source code
eventUpdateImplementation:_old_implementation:address_new_implementation:addressget_implementation:public(address)@externaldefset_implementation(_implementation:address):""" @notice Set the implementation @param _implementation The address of the implementation to use """assertmsg.sender==self.owner# dev: only ownerlogUpdateImplementation(self.get_implementation,_implementation)self.get_implementation=_implementation
Getter for the number of gauges deployed on a specific chain.
Returns: gauge (address).
Input
Type
Description
arg0
uint256
Chain ID
arg1
uint256
Gauge Index
Source code
get_gauge_count:public(HashMap[uint256,uint256])@payable@externaldefdeploy_gauge(_chain_id:uint256,_salt:bytes32)->address:""" @notice Deploy a root liquidity gauge @param _chain_id The chain identifier of the counterpart child gauge @param _salt A value to deterministically deploy a gauge """bridger:address=self.get_bridger[_chain_id]assertbridger!=ZERO_ADDRESS# dev: chain id not supportedimplementation:address=self.get_implementationgauge:address=create_forwarder_to(implementation,value=msg.value,salt=keccak256(_abi_encode(_chain_id,msg.sender,_salt)))idx:uint256=self.get_gauge_count[_chain_id]self.get_gauge[_chain_id][idx]=gaugeself.get_gauge_count[_chain_id]=idx+1self.is_valid_gauge[gauge]=TrueRootGauge(gauge).initialize(bridger,_chain_id)logDeployedGauge(implementation,_chain_id,msg.sender,_salt,gauge)returngauge
is_valid_gauge:public(HashMap[address,bool])@payable@externaldefdeploy_gauge(_chain_id:uint256,_salt:bytes32)->address:""" @notice Deploy a root liquidity gauge @param _chain_id The chain identifier of the counterpart child gauge @param _salt A value to deterministically deploy a gauge """bridger:address=self.get_bridger[_chain_id]assertbridger!=ZERO_ADDRESS# dev: chain id not supportedimplementation:address=self.get_implementationgauge:address=create_forwarder_to(implementation,value=msg.value,salt=keccak256(_abi_encode(_chain_id,msg.sender,_salt)))idx:uint256=self.get_gauge_count[_chain_id]self.get_gauge[_chain_id][idx]=gaugeself.get_gauge_count[_chain_id]=idx+1self.is_valid_gauge[gauge]=TrueRootGauge(gauge).initialize(bridger,_chain_id)logDeployedGauge(implementation,_chain_id,msg.sender,_salt,gauge)returngauge
eventDeployedGauge:_implementation:indexed(address)_chain_id:indexed(uint256)_deployer:indexed(address)_salt:bytes32_gauge:address@payable@externaldefdeploy_gauge(_chain_id:uint256,_salt:bytes32)->address:""" @notice Deploy a root liquidity gauge @param _chain_id The chain identifier of the counterpart child gauge @param _salt A value to deterministically deploy a gauge """bridger:address=self.get_bridger[_chain_id]assertbridger!=ZERO_ADDRESS# dev: chain id not supportedimplementation:address=self.get_implementationgauge:address=create_forwarder_to(implementation,value=msg.value,salt=keccak256(_abi_encode(_chain_id,msg.sender,_salt)))idx:uint256=self.get_gauge_count[_chain_id]self.get_gauge[_chain_id][idx]=gaugeself.get_gauge_count[_chain_id]=idx+1self.is_valid_gauge[gauge]=TrueRootGauge(gauge).initialize(bridger,_chain_id)logDeployedGauge(implementation,_chain_id,msg.sender,_salt,gauge)returngauge
@externaldefdeploy_child_gauge(_chain_id:uint256,_lp_token:address,_salt:bytes32,_manager:address=msg.sender):bridger:address=self.get_bridger[_chain_id]assertbridger!=ZERO_ADDRESS# dev: chain id not supportedCallProxy(self.call_proxy).anyCall(self,_abi_encode(_lp_token,_salt,_manager,method_id=method_id("deploy_gauge(address,bytes32,address)")),ZERO_ADDRESS,_chain_id)
This function is only callable by the owner of the contract.
Function to set a new call proxy contract.
Emits: UpdateCallProxy
Input
Type
Description
_new_call_proxy
address
New CallProxy Contract
Source code
eventUpdateCallProxy:_old_call_proxy:address_new_call_proxy:address@externaldefset_call_proxy(_new_call_proxy:address):""" @notice Set the address of the call proxy used @dev _new_call_proxy should adhere to the same interface as defined @param _new_call_proxy Address of the cross chain call proxy """assertmsg.sender==self.ownerlogUpdateCallProxy(self.call_proxy,_new_call_proxy)self.call_proxy=_new_call_proxy
This function is only callable by the owner of the contract.
Function to set new bridger contract _bridger for _chain_id.
Emits: BridgerUpdated
Input
Type
Description
_chain_id
uint256
Chain ID
_bridger
address
New Bridger Contract
Source code
eventBridgerUpdated:_chain_id:indexed(uint256)_old_bridger:address_new_bridger:address@externaldefset_bridger(_chain_id:uint256,_bridger:address):""" @notice Set the bridger for `_chain_id` @param _chain_id The chain identifier to set the bridger for @param _bridger The bridger contract to use """assertmsg.sender==self.owner# dev: only ownerlogBridgerUpdated(_chain_id,self.get_bridger[_chain_id],_bridger)self.get_bridger[_chain_id]=_bridger
This function is only callable by the owner of the contract.
Function to commit the transfer of contract ownership to _future_owner.
Input
Type
Description
_future_owner
address
Future Owner
Source code
owner:public(address)future_owner:public(address)@externaldefcommit_transfer_ownership(_future_owner:address):""" @notice Transfer ownership to `_future_owner` @param _future_owner The account to commit as the future owner """assertmsg.sender==self.owner# dev: only ownerself.future_owner=_future_owner
This function is only callable by the future_owner of the contract.
Function to accept the transfer of ownership.
Emits: TransferOwnership
Source code
eventTransferOwnership:_old_owner:address_new_owner:addressowner:public(address)future_owner:public(address)@externaldefaccept_transfer_ownership():""" @notice Accept the transfer of ownership @dev Only the committed future owner can call this function """assertmsg.sender==self.future_owner# dev: only future ownerlogTransferOwnership(self.owner,msg.sender)self.owner=msg.sender