Skip to content

Commit

Permalink
added events and getter functions for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
David405 committed Dec 14, 2023
1 parent ef665b6 commit 399054b
Show file tree
Hide file tree
Showing 15 changed files with 15,304 additions and 474 deletions.
1,414 changes: 1,414 additions & 0 deletions abi.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/USDC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ contract USDC is Context, USDCInterface, IERC20, Ownable, IERC20Metadata {
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
return 6;
}

/**
Expand Down
16 changes: 11 additions & 5 deletions contracts/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ contract Vault is
uint256 indexed _mintAmount
);
event Swap(
address indexed _account,
string _zTokenFrom,
string _zTokenTo
uint256 _amount
);
event Withdraw(
address indexed _account,
Expand Down Expand Up @@ -322,7 +321,7 @@ contract Vault is
*/
_mint(zUSD, treasuryWallet, treasuryFeePerTransaction);

emit Swap(msg.sender, _zTokenFrom, _zTokenTo);
emit Swap(_zTokenFrom, _amount);
}

/**
Expand Down Expand Up @@ -568,7 +567,7 @@ contract Vault is

uint256 userColRatio = getUserCollateralRatio(_user);

if (userColRatio < COLLATERIZATION_RATIO_THRESHOLD) {
if (userColRatio < COLLATERIZATION_RATIO_THRESHOLD && userColRatio != 0) {
return true;
}

Expand Down Expand Up @@ -713,10 +712,17 @@ contract Vault is
return IERC20Upgradeable(_address).totalSupply();
}

/**
* Get total number of minters
*/
function getTotalMinters() external view returns (uint256) {
return mintersAddresses.length;
}

/**
* view minters addresses
*/
function viewMintersAddress(uint256 start, uint256 pageSize) external view returns (address[] memory) {
function viewMintersAddress(uint256 start, uint256 pageSize) external view returns (address[] memory) {
uint len = mintersAddresses.length;

require(start < len, "out of range");
Expand Down
Loading

0 comments on commit 399054b

Please sign in to comment.