contract_name stringlengths 1 61 | file_path stringlengths 5 50.4k | contract_address stringlengths 42 42 | language stringclasses 1
value | class_name stringlengths 1 61 | class_code stringlengths 4 330k | class_documentation stringlengths 0 29.1k | class_documentation_type stringclasses 6
values | func_name stringlengths 0 62 | func_code stringlengths 1 303k | func_documentation stringlengths 2 14.9k | func_documentation_type stringclasses 4
values | compiler_version stringlengths 15 42 | license_type stringclasses 14
values | swarm_source stringlengths 0 71 | meta dict | __index_level_0__ int64 0 60.4k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Shares | ERC20.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | ERC20 | abstract contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint8 public override decimals;
constructor(uint8 _decimals) {
decimals = _decimals;
}... | /**
* @dev Implementation of the `IERC20` interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using `_mint`.
* For a generic mechanism see `ERC20Mintable`.
*
* *For a detailed writeup see our guide [How to... | NatSpecMultiLine | _beforeTokenTransfer | function _beforeTokenTransfer(address from, address to, uint256 amount) virtual internal {
}
| /**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* -... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
6162,
6264
]
} | 18,200 |
DDP | /home/user/Documents/Project/solidity/miris-sc/contracts/DDP.sol | 0x95894e0294c21e5aa38108bba758d03743f1e88e | Solidity | DDP | contract DDP is IDDP, AccessControl, Initializable {
/// bond address
address private _bond;
address private _eurxb;
address private _allowList;
uint256 _claimPeriod = 30 days;
constructor(address admin) public {
// admin role for setClaimPeriod only
_setupRole(TokenAccessRoles... | configure | function configure(address bond, address eurxb, address allowList) external initializer {
_bond = bond;
_eurxb = eurxb;
_allowList = allowList;
}
| /**
* @dev configures DDP to use BondToken, EURxb contract and AllowList addresses
* @param bond BondToken contract address
* @param eurxb EURxb contract address
* @param allowList AllowList address
*/ | NatSpecMultiLine | v0.6.3+commit.8dda9521 | {
"func_code_index": [
576,
753
]
} | 18,201 | ||||
DDP | /home/user/Documents/Project/solidity/miris-sc/contracts/DDP.sol | 0x95894e0294c21e5aa38108bba758d03743f1e88e | Solidity | DDP | contract DDP is IDDP, AccessControl, Initializable {
/// bond address
address private _bond;
address private _eurxb;
address private _allowList;
uint256 _claimPeriod = 30 days;
constructor(address admin) public {
// admin role for setClaimPeriod only
_setupRole(TokenAccessRoles... | withdraw | function withdraw(uint256 tokenId) external {
// check if token exists
require(
IBondToken(_bond).hasToken(tokenId),
"bond token id does not exist");
address user = _msgSender();
// get token properties
( uint256 value, /* uint256 interest */, uint256 maturity ) = IBondToken(_bond)... | /**
* repays bond token, any user can call it
*/ | NatSpecMultiLine | v0.6.3+commit.8dda9521 | {
"func_code_index": [
1491,
2879
]
} | 18,202 | ||||
BullrunBabesToken | contracts/BullrunBabesCoordinator.sol | 0x4ad4455ad5ef891695c221e8e683efa65fabede0 | Solidity | BullrunBabesCoordinator | contract BullrunBabesCoordinator is
Context,
AccessControl,
ReentrancyGuard,
BullrunBabesCoordinatorIAdmin
{
using SafeMath for uint256;
using Counters for Counters.Counter;
using EnumerableSet for EnumerableSet.UintSet;
struct CardType {
uint256 typeId;
string cid;
... | _calculatePoolMax | function _calculatePoolMax() private {
uint256[] memory poolMax = new uint256[](combinedPoolAllocation.length);
for (uint256 i = 0; i < combinedPoolAllocation.length; i++) {
uint256 max = 0;
for (uint256 j = 0; j < combinedPoolAllocation[i].length; j++) {
max += combinedPoolAllocatio... | /* Private allocation functions */ | Comment | v0.6.12+commit.27d51765 | Unlicense | {
"func_code_index": [
15339,
15779
]
} | 18,203 | |||
BullrunBabesToken | contracts/BullrunBabesCoordinator.sol | 0x4ad4455ad5ef891695c221e8e683efa65fabede0 | Solidity | BullrunBabesCoordinator | contract BullrunBabesCoordinator is
Context,
AccessControl,
ReentrancyGuard,
BullrunBabesCoordinatorIAdmin
{
using SafeMath for uint256;
using Counters for Counters.Counter;
using EnumerableSet for EnumerableSet.UintSet;
struct CardType {
uint256 typeId;
string cid;
... | withdraw | function withdraw() public payable override nonReentrant {
require(
hasRole(OWNER_ROLE, _msgSender()),
"must have owner role to withdraw"
);
uint256 remainder = (address(this).balance);
uint256 division = remainder.div(100);
for (uint8 i = 0; i < splitAddresses.length; i++) {
... | /* PUBLIC ADMIN ONLY */ | Comment | v0.6.12+commit.27d51765 | Unlicense | {
"func_code_index": [
17510,
18254
]
} | 18,204 | |||
BullrunBabesToken | contracts/BullrunBabesCoordinator.sol | 0x4ad4455ad5ef891695c221e8e683efa65fabede0 | Solidity | BullrunBabesCoordinator | contract BullrunBabesCoordinator is
Context,
AccessControl,
ReentrancyGuard,
BullrunBabesCoordinatorIAdmin
{
using SafeMath for uint256;
using Counters for Counters.Counter;
using EnumerableSet for EnumerableSet.UintSet;
struct CardType {
uint256 typeId;
string cid;
... | getAllocations | function getAllocations()
public
view
override
returns (uint256[][] memory)
{
return combinedPoolAllocation;
}
| /* Public Getters */ | Comment | v0.6.12+commit.27d51765 | Unlicense | {
"func_code_index": [
18281,
18443
]
} | 18,205 | |||
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
97,
157
]
} | 18,206 |
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
240,
313
]
} | 18,207 |
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
537,
619
]
} | 18,208 |
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
898,
986
]
} | 18,209 |
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
1650,
1729
]
} | 18,210 |
MarioToken | INewERC20.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | INewERC20 | interface INewERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
... | /**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/ | NatSpecMultiLine | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
2042,
2144
]
} | 18,211 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | spawn | function spawn(address asset, uint mainAmount, uint usdpAmount) public nonReentrant {
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(vault.getTotalDebt(asset, msg.sender) == 0, "Unit Protocol: SPAWNED_POSITION");
// oracle availability... | /**
* @notice Cannot be used for already spawned positions
* @notice Token using as main collateral must be whitelisted
* @notice Depositing tokens must be pre-approved to vault address
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions
* @param asset The ... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
2079,
2830
]
} | 18,212 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | spawn_Eth | function spawn_Eth(uint usdpAmount) public payable nonReentrant {
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
// check whether the position is spawned
require(vault.getTotalDebt(vault.weth(), msg.sender) == 0, "Unit Protocol: SPAWNED_POSITION");
// oracle availability check
r... | /**
* @notice Cannot be used for already spawned positions
* @notice WETH must be whitelisted as collateral
* @notice position actually considered as spawned only when usdpAmount > 0
* @dev Spawns new positions using ETH
* @param usdpAmount The amount of USDP token to borrow
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
3160,
3903
]
} | 18,213 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | depositAndBorrow | function depositAndBorrow(
address asset,
uint mainAmount,
uint usdpAmount
)
public
spawned(asset, msg.sender)
nonReentrant
{
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
_depositAndBorrow(asset, msg.sender, mainAmount, usdpAmount);
// fire an event
emit Join(as... | /**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param as... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
4439,
4860
]
} | 18,214 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | depositAndBorrow_Eth | function depositAndBorrow_Eth(uint usdpAmount) public payable spawned(vault.weth(), msg.sender) nonReentrant {
require(usdpAmount != 0, "Unit Protocol: ZERO_BORROWING");
_depositAndBorrow_Eth(msg.sender, usdpAmount);
// fire an event
emit Join(vault.weth(), msg.sender, msg.value, usdpAmount);
}... | /**
* @notice Position should be spawned (USDP borrowed from position) to call this method
* @notice Depositing tokens must be pre-approved to vault address
* @notice Token using as main collateral must be whitelisted
* @dev Deposits collaterals and borrows USDP to spawned positions simultaneously
* @param us... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
5262,
5607
]
} | 18,215 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | withdrawAndRepay | function withdrawAndRepay(
address asset,
uint mainAmount,
uint usdpAmount
)
public
spawned(asset, msg.sender)
nonReentrant
{
// check usefulness of tx
require(mainAmount != 0, "Unit Protocol: USELESS_TX");
uint debt = vault.debts(asset, msg.sender);
require(debt != 0 && usdpAm... | /**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously
* @param asset The address of token using as main collateral
* @param mainAmount The amount of main collateral token to withdraw
* @param usdpAmount The am... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
5999,
7040
]
} | 18,216 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | withdrawAndRepay_Eth | function withdrawAndRepay_Eth(
uint ethAmount,
uint usdpAmount
)
public
spawned(vault.weth(), msg.sender)
nonReentrant
{
// check usefulness of tx
require(ethAmount != 0, "Unit Protocol: USELESS_TX");
uint debt = vault.debts(vault.weth(), msg.sender);
require(debt != 0 && usdpAmount... | /**
* @notice Tx sender must have a sufficient USDP balance to pay the debt
* @dev Withdraws collateral and repays specified amount of debt simultaneously converting WETH to ETH
* @param ethAmount The amount of ETH to withdraw
* @param usdpAmount The amount of USDP token to repay
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
7368,
8415
]
} | 18,217 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/vault-managers/VaultManagerKeep3rSushiSwapMainAsset.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | VaultManagerKeep3rSushiSwapMainAsset | contract VaultManagerKeep3rSushiSwapMainAsset is ReentrancyGuard {
using SafeMath for uint;
Vault public immutable vault;
VaultManagerParameters public immutable vaultManagerParameters;
ChainlinkedOracleSimple public immutable oracle;
uint public constant ORACLE_TYPE = 7;
uint public con... | /**
* @title VaultManagerKeep3rSushiSwapMainAsset
**/ | NatSpecMultiLine | _ensureCollateralization | function _ensureCollateralization(
address asset,
address user,
uint mainUsdValue_q112
)
internal
view
{
// USD limit of the position
uint usdLimit = mainUsdValue_q112 * vaultManagerParameters.initialCollateralRatio(asset) / Q112 / 100;
// revert if collateralization is not enough
... | // ensures that borrowed value is in desired range | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
9909,
10379
]
} | 18,218 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | setTotalShares | function setTotalShares(uint256 _newTotalShares) public onlyOwner() {
require(_newTotalShares >= totalValidSupply(), "below supply");
totalShares = _newTotalShares;
}
| /**
* Declares the number of total shares, including those that have not been tokenized and those
* that are held by the company itself. This number can be substiantially higher than totalSupply()
* in case not all shares have been tokenized. Also, it can be lower than totalSupply() in case some
* tokens have b... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
1145,
1339
]
} | 18,219 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | recognizeSubRegister | function recognizeSubRegister(address contractAddress) public onlyOwner () {
emit SubRegisterRecognized(contractAddress);
}
| /**
* Sometimes, tokens are held by other smart contracts that serve as registers themselves. These could
* be our draggable contract, it could be a bridget to another blockchain, or it could be an address
* that belongs to a recognized custodian.
* We assume that the number of sub registers stays limited, such... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
2017,
2159
]
} | 18,220 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | announcement | function announcement(string calldata message) external onlyOwner() {
emit Announcement(message);
}
| /**
* Allows the issuer to make public announcements that are visible on the blockchain.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
2271,
2389
]
} | 18,221 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | setCustomClaimCollateral | function setCustomClaimCollateral(address collateral, uint256 rate) public onlyOwner() {
super._setCustomClaimCollateral(collateral, rate);
}
| /**
* See parent method for collateral requirements.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
2465,
2625
]
} | 18,222 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | declareInvalid | function declareInvalid(address holder, uint256 amount, string calldata message) external onlyOwner() {
uint256 holderBalance = balanceOf(holder);
require(amount <= holderBalance);
invalidTokens += amount;
emit TokensDeclaredInvalid(holder, amount, message);
}
| /**
* Signals that the indicated tokens have been declared invalid (e.g. by a court ruling in accordance
* with article 973g of the Swiss Code of Obligations) and got detached from
* the underlying shares. Invalid tokens do not carry any shareholder rights any more.
*
* This function is purely declarative. It... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
3194,
3500
]
} | 18,223 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | totalValidSupply | function totalValidSupply() public view returns (uint256) {
return totalSupply() - invalidTokens;
}
| /**
* The total number of valid tokens in circulation. In case some tokens have been declared invalid, this
* number might be lower than totalSupply(). Also, it will always be lower than or equal to totalShares().
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
3743,
3861
]
} | 18,224 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | mintAndCall | function mintAndCall(address shareholder, address callee, uint256 amount, bytes calldata data) public {
mint(callee, amount);
IERC677Receiver(callee).onTokenTransfer(shareholder, amount, data);
}
| /**
* Allows the company to tokenize shares. If these shares are newly created, setTotalShares must be
* called first in order to adjust the total number of shares.
*/ | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
4055,
4278
]
} | 18,225 |
Shares | Shares.sol | 0x2adcbee886d23eff5adecc7767bf102e4a1ce151 | Solidity | Shares | contract Shares is ERC20Recoverable, ERC20Named {
string public terms;
uint256 public totalShares = 0; // total number of shares, maybe not all tokenized
uint256 public invalidTokens = 0;
event Announcement(string message);
event TokensDeclaredInvalid(address indexed holder, uint256 amoun... | /**
* @title CompanyName AG Shares
* @author Luzius Meisser, luzius@aktionariat.com
*
* These tokens are uncertified shares (Wertrechte according to the Swiss code of obligations),
* with this smart contract serving as onwership registry (Wertrechtebuch), but not as shareholder
* registry, which is kept sep... | NatSpecMultiLine | burn | function burn(uint256 _amount) public {
require(_amount <= balanceOf(msg.sender), "Not enough shares available");
_transfer(msg.sender, address(this), _amount);
_burn(address(this), _amount);
}
| /**
* Transfers _amount tokens to the company and burns them.
* The meaning of this operation depends on the circumstances and the fate of the shares does
* not necessarily follow the fate of the tokens. For example, the company itself might call
* this function to implement a formal decision to destroy some of... | NatSpecMultiLine | v0.8.6+commit.11564f7e | MIT | ipfs://1147be0eeabda03a2c46b74f348bfb79bc954b5279f73a6d06c971502d84df94 | {
"func_code_index": [
5541,
5771
]
} | 18,226 |
MarioToken | Ownable.sol | 0xbff658ee300cfc7ffd5d182208bce73831925bab | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msg... | /**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
... | NatSpecMultiLine | owner | function owner() internal view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | MIT | ipfs://2212624da6dbe73978749c2cf96d1867a765a893de13db500f299d5dbf1255a7 | {
"func_code_index": [
716,
802
]
} | 18,227 |
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | totalSupply | function totalSupply() external view returns (uint256);
| /**
* @dev Returns the amount of tokens in existence.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
94,
154
]
} | 18,228 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | balanceOf | function balanceOf(address account) external view returns (uint256);
| /**
* @dev Returns the amount of tokens owned by `account`.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
235,
308
]
} | 18,229 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | transfer | function transfer(address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
530,
612
]
} | 18,230 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | allowance | function allowance(address owner, address spender) external view returns (uint256);
| /**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
889,
977
]
} | 18,231 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | approve | function approve(address spender, uint256 amount) external returns (bool);
| /**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
1639,
1718
]
} | 18,232 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | IERC20 | interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
... | transferFrom | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
| /**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
2029,
2131
]
} | 18,233 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | add | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| /**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
259,
445
]
} | 18,234 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
721,
862
]
} | 18,235 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | sub | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| /**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
1158,
1353
]
} | 18,236 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mul | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
... | /**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
1605,
2077
]
} | 18,237 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to reve... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
2546,
2683
]
} | 18,238 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | div | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
| /**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an in... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
3172,
3453
]
} | 18,239 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consumi... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
3911,
4046
]
} | 18,240 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | SafeMath | library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns ... | mod | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| /**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcod... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
4524,
4695
]
} | 18,241 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | isContract | function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codeha... | /**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
606,
1230
]
} | 18,242 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | sendValue | function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address... | /**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `tr... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
2158,
2560
]
} | 18,243 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | functionCall | function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
| /**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw ... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
3314,
3492
]
} | 18,244 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | functionCall | function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
3715,
3916
]
} | 18,245 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
| /**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*... | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
4284,
4515
]
} | 18,246 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Address | library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will ... | functionCallWithValue | function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
| /**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
4764,
5085
]
} | 18,247 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... | owner | function owner() public view returns (address) {
return _owner;
}
| /**
* @dev Returns the address of the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
493,
577
]
} | 18,248 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... | renounceOwnership | function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
| /**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
1131,
1284
]
} | 18,249 | ||
BULLDEFI | BULLDEFI.sol | 0xa5834a8ebbcf434c1a303da940d181daf2ad2ce5 | Solidity | Ownable | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... | transferOwnership | function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| /**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/ | NatSpecMultiLine | v0.6.12+commit.27d51765 | None | ipfs://7a2aa3877dabc39fab026699df70eba2c041d921bd546687bca887434e0b9488 | {
"func_code_index": [
1432,
1681
]
} | 18,250 | ||
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | // only accept ETH via fallback from the WETH contract | LineComment | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
2031,
2138
]
} | 18,251 | ||
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | update | function update(address asset, address user) public hasVaultAccess notLiquidating(asset, user) {
// calculate fee using stored stability fee
uint debtWithFee = getTotalDebt(asset, user);
tokenDebts[asset] = tokenDebts[asset].sub(debts[asset][user]).add(debtWithFee);
debts[asset][user] = debtWithFe... | /**
* @dev Updates parameters of the position to the current ones
* @param asset The address of the main collateral token
* @param user The owner of a position
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
2334,
2890
]
} | 18,252 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | spawn | function spawn(address asset, address user, uint _oracleType) external hasVaultAccess notLiquidating(asset, user) {
oracleType[asset][user] = _oracleType;
delete liquidationBlock[asset][user];
}
| /**
* @dev Creates new position for user
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param _oracleType The type of an oracle
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
3120,
3342
]
} | 18,253 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | destroy | function destroy(address asset, address user) public hasVaultAccess notLiquidating(asset, user) {
delete stabilityFee[asset][user];
delete oracleType[asset][user];
delete lastUpdate[asset][user];
delete liquidationFee[asset][user];
}
| /**
* @dev Clears unused storage variables
* @param asset The address of the main collateral token
* @param user The address of a position's owner
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
3525,
3804
]
} | 18,254 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | depositMain | function depositMain(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) {
collaterals[asset][user] = collaterals[asset][user].add(amount);
TransferHelper.safeTransferFrom(asset, user, address(this), amount);
}
| /**
* @notice Tokens must be pre-approved
* @dev Adds main collateral to a position
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of tokens to deposit
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
4088,
4368
]
} | 18,255 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | depositEth | function depositEth(address user) external payable notLiquidating(weth, user) {
IWETH(weth).deposit{value: msg.value}();
collaterals[weth][user] = collaterals[weth][user].add(msg.value);
}
| /**
* @dev Converts ETH to WETH and adds main collateral to a position
* @param user The address of a position's owner
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
4517,
4733
]
} | 18,256 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | withdrawMain | function withdrawMain(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) {
collaterals[asset][user] = collaterals[asset][user].sub(amount);
TransferHelper.safeTransfer(asset, user, amount);
}
| /**
* @dev Withdraws main collateral from a position
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of tokens to withdraw
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
4981,
5243
]
} | 18,257 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | withdrawEth | function withdrawEth(address payable user, uint amount) external hasVaultAccess notLiquidating(weth, user) {
collaterals[weth][user] = collaterals[weth][user].sub(amount);
IWETH(weth).withdraw(amount);
TransferHelper.safeTransferETH(user, amount);
}
| /**
* @dev Withdraws WETH collateral from a position converting WETH to ETH
* @param user The address of a position's owner
* @param amount The amount of ETH to withdraw
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
5449,
5735
]
} | 18,258 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | depositCol | function depositCol(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) {
colToken[asset][user] = colToken[asset][user].add(amount);
TransferHelper.safeTransferFrom(col, user, address(this), amount);
}
| /**
* @notice Tokens must be pre-approved
* @dev Adds COL token to a position
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of tokens to deposit
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
6013,
6284
]
} | 18,259 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | withdrawCol | function withdrawCol(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) {
colToken[asset][user] = colToken[asset][user].sub(amount);
TransferHelper.safeTransfer(col, user, amount);
}
| /**
* @dev Withdraws COL token from a position
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of tokens to withdraw
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
6526,
6779
]
} | 18,260 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | borrow | function borrow(
address asset,
address user,
uint amount
)
external
hasVaultAccess
notLiquidating(asset, user)
returns(uint)
{
require(vaultParameters.isOracleTypeEnabled(oracleType[asset][user], asset), "Unit Protocol: WRONG_ORACLE_TYPE");
update(asset, user);
debts[asset][user] = ... | /**
* @dev Increases position's debt and mints USDP token
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of USDP to borrow
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
7028,
7733
]
} | 18,261 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | repay | function repay(
address asset,
address user,
uint amount
)
external
hasVaultAccess
notLiquidating(asset, user)
returns(uint)
{
uint debt = debts[asset][user];
debts[asset][user] = debt.sub(amount);
tokenDebts[asset] = tokenDebts[asset].sub(amount);
USDP(usdp).burn(user, amount);... | /**
* @dev Decreases position's debt and burns USDP token
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The amount of USDP to repay
* @return updated debt of a position
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
8024,
8446
]
} | 18,262 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | chargeFee | function chargeFee(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) {
if (amount != 0) {
TransferHelper.safeTransferFrom(asset, user, vaultParameters.foundation(), amount);
}
}
| /**
* @dev Transfers fee to foundation
* @param asset The address of the fee asset
* @param user The address to transfer funds from
* @param amount The amount of asset to transfer
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
8668,
8930
]
} | 18,263 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | triggerLiquidation | function triggerLiquidation(
address asset,
address positionOwner,
uint initialPrice
)
external
hasVaultAccess
notLiquidating(asset, positionOwner)
{
// reverts if oracle type is disabled
require(vaultParameters.isOracleTypeEnabled(oracleType[asset][positionOwner], asset), "Unit Protocol: ... | /**
* @dev Deletes position and transfers collateral to liquidation system
* @param asset The address of the main collateral token
* @param positionOwner The address of a position's owner
* @param initialPrice The starting price of collateral in USDP
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
9223,
9847
]
} | 18,264 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | liquidate | function liquidate(
address asset,
address positionOwner,
uint mainAssetToLiquidator,
uint colToLiquidator,
uint mainAssetToPositionOwner,
uint colToPositionOwner,
uint repayment,
uint penalty,
address liquidator
)
external
hasVaultAccess
{
require(liquidati... | /**
* @dev Internal liquidation process
* @param asset The address of the main collateral token
* @param positionOwner The address of a position's owner
* @param mainAssetToLiquidator The amount of main asset to send to a liquidator
* @param colToLiquidator The amount of COL to send to a liquidator
* @param... | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
10524,
13101
]
} | 18,265 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | changeOracleType | function changeOracleType(address asset, address user, uint newOracleType) external onlyManager {
oracleType[asset][user] = newOracleType;
}
| /**
* @notice Only manager can call this function
* @dev Changes broken oracle type to the correct one
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param newOracleType The new type of an oracle
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
13405,
13564
]
} | 18,266 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | getTotalDebt | function getTotalDebt(address asset, address user) public view returns (uint) {
uint debt = debts[asset][user];
if (liquidationBlock[asset][user] != 0) return debt;
uint fee = calculateFee(asset, user, debt);
return debt.add(fee);
}
| /**
* @dev Calculates the total amount of position's debt based on elapsed time
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @return user debt of a position plus accumulated fee
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
13845,
14123
]
} | 18,267 |
VaultManagerKeep3rSushiSwapMainAsset | contracts/Vault.sol | 0x54ba276a62e7e3e76d362f672f00ed31a983067b | Solidity | Vault | contract Vault is Auth {
using SafeMath for uint;
// COL token address
address public immutable col;
// WETH token address
address payable public immutable weth;
uint public constant DENOMINATOR_1E5 = 1e5;
uint public constant DENOMINATOR_1E2 = 1e2;
// USDP token addres... | /**
* @title Vault
* @notice Vault is the core of Unit Protocol USDP Stablecoin system
* @notice Vault stores and manages collateral funds of all positions and counts debts
* @notice Only Vault can manage supply of USDP token
* @notice Vault will not be changed/upgraded after initial deployment for the curren... | NatSpecMultiLine | calculateFee | function calculateFee(address asset, address user, uint amount) public view returns (uint) {
uint sFeePercent = stabilityFee[asset][user];
uint timePast = block.timestamp.sub(lastUpdate[asset][user]);
return amount.mul(sFeePercent).mul(timePast).div(365 days).div(DENOMINATOR_1E5);
}
| /**
* @dev Calculates the amount of fee based on elapsed time and repayment amount
* @param asset The address of the main collateral token
* @param user The address of a position's owner
* @param amount The repayment amount
* @return fee amount
**/ | NatSpecMultiLine | v0.7.6+commit.7338295f | MIT | ipfs://460c622b56a32af6b33d24576527be2ca4e91baf1cd5f56184cd15398ff7c3e8 | {
"func_code_index": [
14416,
14738
]
} | 18,268 |
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Controlled | contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController {
require(msg.sender == controller);
_;
}
//block for check//bool private initialed = false;
address public co... | //normal contract. already compiled as bin | LineComment | changeController | function changeController(address _newController) onlyController public {
controller = _newController;
}
| /// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
623,
746
]
} | 18,269 | |
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) payable public returns(bool);
... | //abstract contract. used for interface | LineComment | proxyPayment | function proxyPayment(address _owner) payable public returns(bool);
| /// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
246,
318
]
} | 18,270 | |
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) payable public returns(bool);
... | //abstract contract. used for interface | LineComment | onTransfer | function onTransfer(address _from, address _to, uint _amount) public returns(bool);
| /// @notice Notifies the controller about a token transfer allowing the
/// controller to react if desired
/// @param _from The origin of the transfer
/// @param _to The destination of the transfer
/// @param _amount The amount of the transfer
/// @return False if the controller does not authorize the transfer | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
664,
752
]
} | 18,271 | |
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenController | contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) payable public returns(bool);
... | //abstract contract. used for interface | LineComment | onApprove | function onApprove(address _owner, address _spender, uint _amount) public returns(bool);
| /// @notice Notifies the controller about an approval allowing the
/// controller to react if desired
/// @param _owner The address that calls `approve()`
/// @param _spender The spender in the `approve()` call
/// @param _amount The amount in the `approve()` call
/// @return False if the controller does not authorize... | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1119,
1212
]
} | 18,272 | |
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | ERC20Token | contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contrac... | transfer | function transfer(address _to, uint256 _value) public returns (bool success);
| /// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1094,
1176
]
} | 18,273 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | ERC20Token | contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contrac... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
| /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1499,
1600
]
} | 18,274 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | ERC20Token | contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contrac... | approve | function approve(address _spender, uint256 _value) public returns (bool success);
| /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1890,
1976
]
} | 18,275 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenI | contract TokenI is ERC20Token, Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
// ERC20 Methods
/// @notice ... | approveAndCall | function approveAndCall(
address _spender,
uint256 _amount,
bytes _extraData
) public returns (bool success);
| /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of... | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
822,
968
]
} | 18,276 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenI | contract TokenI is ERC20Token, Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
// ERC20 Methods
/// @notice ... | generateTokens | function generateTokens(address _owner, uint _amount) public returns (bool);
| /// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _owner The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1274,
1355
]
} | 18,277 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenI | contract TokenI is ERC20Token, Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
// ERC20 Methods
/// @notice ... | destroyTokens | function destroyTokens(address _owner, uint _amount) public returns (bool);
| /// @notice Burns `_amount` tokens from `_owner`
/// @param _owner The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1587,
1667
]
} | 18,278 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenI | contract TokenI is ERC20Token, Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
// ERC20 Methods
/// @notice ... | enableTransfers | function enableTransfers(bool _transfersEnabled) public;
| /// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1826,
1887
]
} | 18,279 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | TokenI | contract TokenI is ERC20Token, Controlled {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
string public symbol; //An identifier: e.g. REP
// ERC20 Methods
/// @notice ... | claimTokens | function claimTokens(address _token) public;
| /// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether. | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
2174,
2223
]
} | 18,280 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | Token | function Token(
uint256 initialSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol,
bool transfersEnable
) public {
balanceOf[msg.sender] = initialSupply;
totalSupply = initialSupply;
name = tokenName;
symbol = tokenSymbol;
decimals = decimalUnits;
... | /* Initializes contract with initial supply tokens to the creator of the contract */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
1232,
1678
]
} | 18,281 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | isContract | function isContract(address _addr) constant internal returns(bool) {
uint size;
if (_addr == 0) {
return false;
}
assembly {
size := extcodesize(_addr)
}
return size>0;
}
| /// @dev Internal function to determine if an address is a contract
/// @param _addr The address being queried
/// @return True if `_addr` is a contract | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
2640,
2900
]
} | 18,282 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | transfer | function transfer(address _to, uint256 _value) realUser(_to) moreThanZero(_value) transable public returns (bool) {
//infoAddr('msg.sender', msg.sender);
//infoBool('typeOf msg.sender', isContract(msg.sender));
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
//re... | /* Send coins */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
2925,
3607
]
} | 18,283 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | approve | function approve(address _spender, uint256 _value) moreThanZero(_value) transable public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| /* Allow another contract to spend some tokens in your behalf */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
3680,
3887
]
} | 18,284 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | approveAndCall | function approveAndCall(address _spender, uint256 _amount, bytes _extraData) transable public returns (bool success) {
require(approve(_spender, _amount));
ApproveAndCallReceiver(_spender).receiveApproval(
msg.sender,
_amount,
this,
_extraData
);
return true;
... | /**
* @notice `msg.sender` approves `_spender` to send `_amount` tokens on
* its behalf, and then a function is triggered in the contract that is
* being approved, `_spender`. This allows users to use their tokens to
* interact with contracts in one function call instead of two
* @param _spender The addres... | NatSpecMultiLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
4419,
4782
]
} | 18,285 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | transferFrom | function transferFrom(address _from, address _to, uint256 _value) realUser(_from) realUser(_to) moreThanZero(_value) transable public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value > balanceOf[_to]); // Check fo... | /* A contract attempts to get the coins */ | Comment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
4833,
5635
]
} | 18,286 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | freeze | function freeze(address _user, uint256 _value, uint8 _step) moreThanZero(_value) onlyController public returns (bool success) {
//info256("balanceOf[_user]", balanceOf[_user]);
require(balanceOf[_user] >= _value);
balanceOf[_user] = balanceOf[_user] - _value;
freezeOf[_step][lastFreezeSeq[_step]] = ... | //只能自己或者 owner 才能冻结账户 | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
6511,
6986
]
} | 18,287 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | unFreeze | function unFreeze(uint8 _step) onlyOwner public returns (bool unlockOver) {
//_end = length of freezeOf[_step]
uint32 _end = lastFreezeSeq[_step];
require(_end > 0);
//info("_end", _end);
unlockOver = (_end <= 99);
uint32 _start = (_end > 99) ? _end-100 : 0;
//info("_start", _start);
... | //为用户解锁账户资金 | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
7198,
7888
]
} | 18,288 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | function() payable public {
//屏蔽控制方的合约类型检查,以兼容发行方无控制合约的情况。
require(isContract(controller));
bool proxyPayment = TokenController(controller).proxyPayment.value(msg.value)(msg.sender);
require(proxyPayment);
}
| //accept ether | LineComment | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
7915,
8168
]
} | 18,289 | ||||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | generateTokens | function generateTokens(address _user, uint _amount) onlyController public returns (bool) {
require(balanceOf[owner] >= _amount);
balanceOf[_user] += _amount;
balanceOf[owner] -= _amount;
Transfer(0, _user, _amount);
return true;
}
| ////////////////
/// @notice Generates `_amount` tokens that are assigned to `_owner`
/// @param _user The address that will be assigned the new tokens
/// @param _amount The quantity of tokens generated
/// @return True if the tokens are generated correctly | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
8515,
8801
]
} | 18,290 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | destroyTokens | function destroyTokens(address _user, uint _amount) onlyOwner public returns (bool) {
require(balanceOf[_user] >= _amount);
balanceOf[owner] += _amount;
balanceOf[_user] -= _amount;
Transfer(_user, 0, _amount);
Burn(_user, _amount);
return true;
}
| /// @notice Burns `_amount` tokens from `_owner`
/// @param _user The address that will lose the tokens
/// @param _amount The quantity of tokens to burn
/// @return True if the tokens are burned correctly | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
9030,
9341
]
} | 18,291 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | enableTransfers | function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
| ////////////////
/// @notice Enables token holders to transfer their tokens freely if true
/// @param _transfersEnabled True if transfers are allowed in the clone | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
9578,
9704
]
} | 18,292 | |||
Token | Token.sol | 0xa7d81c86f9934b56dd00fa826c319330d628d31f | Solidity | Token | contract Token is TokenI {
using SafeMath for uint256;
string public techProvider = "WeYii Tech";
string public officialSite = "http://www.beautybloc.io";
address public owner;
struct FreezeInfo {
address user;
uint256 amount;
}
//Key1: step(募资阶段); Key2: user s... | claimTokens | function claimTokens(address _token) onlyController public {
if (_token == 0x0) {
controller.transfer(this.balance);
return;
}
Token token = Token(_token);
uint balance = token.balanceOf(this);
token.transfer(controller, balance);
ClaimedTokens(_token, controller, balan... | //////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// set to 0 in case you want to extract ether. | NatSpecSingleLine | v0.4.19+commit.c4cbbb05 | bzzr://a3f1d1241fe347ce58b028d9853546be51435da55745b43c13a7254078db39e0 | {
"func_code_index": [
9939,
10307
]
} | 18,293 | |||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
... | NatSpecMultiLine | _delegate | function _delegate(address implementation) internal {
// solhint-disable-next-line no-inline-assembly
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at... | /**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
229,
1141
]
} | 18,294 |
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
... | NatSpecMultiLine | _implementation | function _implementation() internal virtual view returns (address);
| /**
* @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
1325,
1397
]
} | 18,295 |
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
... | NatSpecMultiLine | _fallback | function _fallback() internal {
_delegate(_implementation());
}
| /**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
1629,
1711
]
} | 18,296 |
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
... | NatSpecMultiLine | /**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
1909,
1973
]
} | 18,297 | ||
InitializableAdminUpgradeabilityProxy | contracts/proxy/Proxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | Proxy | abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal {
// solhint-disable-next-... | /**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
... | NatSpecMultiLine | /**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
2134,
2197
]
} | 18,298 | ||
InitializableAdminUpgradeabilityProxy | contracts/proxy/BaseUpgradeabilityProxy.sol | 0x90b420d936f9a768565bac7a085558aeff786f9e | Solidity | BaseUpgradeabilityProxy | contract BaseUpgradeabilityProxy is Proxy {
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT... | /**
* @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
* implementation address that can be changed. This address is stored in storage in the location specified by
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storag... | NatSpecMultiLine | _implementation | function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
impl := sload(slot)
}
}
| /**
* @dev Returns the current implementation address.
*/ | NatSpecMultiLine | v0.8.0+commit.c7dfd78e | MIT | ipfs://0ca5436b0a85f7b9ce3d93f47729c39a8a3f5e921b02bdeedecedaebfc4ed918 | {
"func_code_index": [
524,
776
]
} | 18,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.