Synth sUSD
About
Stats
Public Functions
6
Event Types
3
Code Size
6,360 bytes
Functions
nominateNewOwner keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
acceptOwnership keyboard_arrow_up
setTarget keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setTarget(Proxyable _target) external onlyOwner {
target = _target;
emit TargetUpdated(_target);
}
setUseDELEGATECALL keyboard_arrow_up
_emit keyboard_arrow_up
Parameters help
Modifiers help
onlyTarget checks for the following:
Source Code
function _emit(
bytes callData,
uint256 numTopics,
bytes32 topic1,
bytes32 topic2,
bytes32 topic3,
bytes32 topic4
) external onlyTarget {
uint256 size = callData.length;
bytes memory _callData = callData;
assembly {
/* The first 32 bytes of callData contain its length (as specified by the abi).
* Length is assumed to be a uint256 and therefore maximum of 32 bytes
* in length. It is also leftpadded to be a multiple of 32 bytes.
* This means moving call_data across 32 bytes guarantees we correctly access
* the data itself. */
switch numTopics
case 0 {
log0(add(_callData, 32), size)
}
case 1 {
log1(add(_callData, 32), size, topic1)
}
case 2 {
log2(add(_callData, 32), size, topic1, topic2)
}
case 3 {
log3(add(_callData, 32), size, topic1, topic2, topic3)
}
case 4 {
log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
}
}
}
constructor keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function() external payable {
if (useDELEGATECALL) {
assembly {
/* Copy call data into free memory region. */
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
/* Forward all gas and call data to the target contract. */
let result := delegatecall(
gas,
sload(target_slot),
free_ptr,
calldatasize,
0,
0
)
returndatacopy(free_ptr, 0, returndatasize)
/* Revert if the call failed, otherwise return the result. */
if iszero(result) {
revert(free_ptr, returndatasize)
}
return(free_ptr, returndatasize)
}
} else {
/* Here we are as above, but must send the messageSender explicitly
* since we are using CALL rather than DELEGATECALL. */
target.setMessageSender(msg.sender);
assembly {
let free_ptr := mload(0x40)
calldatacopy(free_ptr, 0, calldatasize)
/* We must explicitly forward ether to the underlying contract as well. */
let result := call(
gas,
sload(target_slot),
callvalue,
free_ptr,
calldatasize,
0,
0
)
returndatacopy(free_ptr, 0, returndatasize)
if iszero(result) {
revert(free_ptr, returndatasize)
}
return(free_ptr, returndatasize)
}
}
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.