Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: qa core contracts changes #19

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: CodeQL Analysis
on:
pull_request:
push:
branches:
- development

jobs:
code-ql-analysis:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/core-contracts-storage-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,24 @@ jobs:
with:
version: nightly

- id: set-matrix
- name: Narrow down test matrix scope to changed contracts to limit API requests
id: changed-contracts
uses: tj-actions/changed-files@v42
with:
files_yaml: |
contracts:
- packages/contracts/src/dollar/core/*.sol

- name: Set contracts matrix
id: set-matrix
working-directory: packages/contracts
if: steps.changed-contracts.outputs.contracts_any_changed == 'true'
env:
CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }}
run: |
forge tree | grep -E '^src/dollar/core' | cut -d' ' -f1 | xargs basename -s | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt
for CONTRACT in "$CHANGED_CONTRACTS"; do
echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt
done
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT

outputs:
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/dollar/core/StakingShare.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ contract StakingShare is ERC1155Ubiquity, ERC1155URIStorageUpgradeable {
uint256 endBlock;
// lp remaining for a user
uint256 lpAmount;
uint256 safeChange;
}

/// @notice Mapping of stake id to stake info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ contract UbiquityCreditToken is ERC20Ubiquity {

// ----------- Modifiers -----------

// comment added
/// @notice Modifier checks that the method is called by a user with the "Credit minter" role
modifier onlyCreditMinter() {
require(
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/src/dollar/interfaces/IBondingCurve.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ interface IBondingCurve {
*/
function setParams(uint32 _connectorWeight, uint256 _baseY) external;

// interface comment added

/**
* @notice Returns `connectorWeight` value
* @return Connector weight value
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/dollar/libraries/LibStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ library LibStaking {
uint256 accLpRewardPerShare;
uint256 lpRewards;
uint256 totalLpToMigrate;
uint256 libraryStructChanged;
}

/**
Expand Down