Skip to content

Commit b032676

Browse files
authored
Merge pull request #658 from VenusProtocol/develop
New release
2 parents f4c441e + 99dd62d commit b032676

File tree

205 files changed

+150869
-69560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+150869
-69560
lines changed

.github/prepare_slim_package.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Create a slim folder with the minium content we want, and remove unneeded files
2+
mkdir slim && cp -r artifacts* package.json README.md deployments slim && cd slim
3+
find deployments -mindepth 1 -depth -not -name "*_addresses.json*" -exec rm -r "{}" +
4+
find artifacts -mindepth 1 -depth -not -regex "artifacts/contracts.*" -exec rm -r "{}" +
5+
find artifacts-zk -mindepth 1 -depth -not -regex "artifacts-zk/contracts.*" -exec rm -r "{}" +
6+
find artifacts -mindepth 1 -depth -regex "artifacts/.*dbg\.json" -exec rm -r "{}" +
7+
8+
# Add "-slim" to the version in the npm package, keeping the tag "-dev" if it exists
9+
jq '.version |= sub("^(?<core>[0-9]+\\.[0-9]+\\.[0-9]+)"; "\(.core)-slim")' package.json > package.tmp.json && mv package.tmp.json package.json
10+
11+
# Remove the "prepare" and "postinstall" scripts, they won't work for this slim version
12+
jq 'del(.scripts.prepare)' package.json > package.tmp.json && mv package.tmp.json package.json
13+
jq 'del(.scripts.postinstall)' package.json > package.tmp.json && mv package.tmp.json package.json
14+
15+
# Empty devDependencies and dependencies
16+
jq '.dependencies = {}' package.json > package.tmp.json && mv package.tmp.json package.json
17+
jq '.devDependencies = {}' package.json > package.tmp.json && mv package.tmp.json package.json

.github/workflows/cd.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
- main
77
- develop
88

9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: read
12+
913
jobs:
1014
release:
1115
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
1218
steps:
1319
- name: Checkout
1420
uses: actions/checkout@v3
@@ -18,8 +24,9 @@ jobs:
1824

1925
- uses: actions/setup-node@v3
2026
with:
21-
node-version: 18
2227
cache: "yarn"
28+
node-version: "22.14.0"
29+
registry-url: "https://registry.npmjs.org"
2330

2431
- name: Install dependencies
2532
# Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error
@@ -34,9 +41,24 @@ jobs:
3441
- name: Release
3542
env:
3643
GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }}
37-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3844
GIT_AUTHOR_NAME: Venus Tools
3945
GIT_AUTHOR_EMAIL: tools@venus.io
4046
GIT_COMMITTER_NAME: Venus Tools
4147
GIT_COMMITTER_EMAIL: tools@venus.io
4248
run: yarn semantic-release
49+
50+
- name: Prepare slim package
51+
run: bash .github/prepare_slim_package.sh
52+
53+
- name: Publish slim package
54+
run: |
55+
# Ensure npm 11.5.1 or later is installed
56+
npm install -g npm@latest
57+
58+
cd slim
59+
60+
# Extract to PRE_RELEASE_TAG the tag in the version field of the package json, or the empty string if it doesn't exist
61+
PRE_RELEASE_TAG=$(jq -r '.version | if test("-") then capture("^[0-9]+\\.[0-9]+\\.[0-9]+-(?<tag>[a-zA-Z-]+)") | .tag else "" end' package.json)
62+
63+
# Publish the package to a custom tag for slim versions
64+
npm publish --access public --tag $PRE_RELEASE_TAG

CHANGELOG.md

Lines changed: 224 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $ yarn hardhat --network <network-name> --export ./deployments/<network-name>.js
130130
### Source Code Verification
131131

132132
In order to verify the source code of already deployed contracts, run:
133-
`npx hardhat etherscan-verify --network <network_name>`
133+
`npx hardhat verify --network <network-name> <contract-address> <constructor-arg1> <constructor-arg2>`
134134

135135
Make sure you have added `ETHERSCAN_API_KEY` in `.env` file.
136136

6.49 MB
Binary file not shown.
557 KB
Binary file not shown.
448 KB
Binary file not shown.

contracts/Comptroller/ComptrollerInterface.sol

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ interface ComptrollerInterface {
4444

4545
function borrowVerify(address vToken, address borrower, uint borrowAmount) external;
4646

47+
function executeFlashLoan(
48+
address payable onBehalf,
49+
address payable receiver,
50+
VToken[] calldata vTokens,
51+
uint256[] calldata underlyingAmounts,
52+
bytes calldata param
53+
) external;
54+
4755
function repayBorrowAllowed(
4856
address vToken,
4957
address payer,
@@ -160,6 +168,8 @@ interface ComptrollerInterface {
160168

161169
function vaiMintRate() external view returns (uint);
162170

171+
function authorizedFlashLoan(address account) external view returns (bool);
172+
163173
function userPoolId(address account) external view returns (uint96);
164174

165175
function getLiquidationIncentive(address vToken) external view returns (uint256);
@@ -197,6 +207,8 @@ interface ComptrollerInterface {
197207
uint96 marketPoolId,
198208
bool isBorrowAllowed
199209
);
210+
211+
function isFlashLoanPaused() external view returns (bool);
200212
}
201213

202214
interface IVAIVault {

contracts/Comptroller/ComptrollerStorage.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,11 @@ contract ComptrollerV17Storage is ComptrollerV16Storage {
320320
*/
321321
uint96 public lastPoolId;
322322
}
323+
324+
contract ComptrollerV18Storage is ComptrollerV17Storage {
325+
/// @notice Mapping of accounts authorized to execute flash loans
326+
mapping(address => bool) public authorizedFlashLoan;
327+
328+
/// @notice Whether flash loans are paused system-wide
329+
bool public flashLoanPaused;
330+
}

contracts/Comptroller/Diamond/Diamond.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ pragma solidity 0.8.25;
44

55
import { IDiamondCut } from "./interfaces/IDiamondCut.sol";
66
import { Unitroller } from "../Unitroller.sol";
7-
import { ComptrollerV17Storage } from "../ComptrollerStorage.sol";
7+
import { ComptrollerV18Storage } from "../ComptrollerStorage.sol";
88

99
/**
1010
* @title Diamond
1111
* @author Venus
1212
* @notice This contract contains functions related to facets
1313
*/
14-
contract Diamond is IDiamondCut, ComptrollerV17Storage {
14+
contract Diamond is IDiamondCut, ComptrollerV18Storage {
1515
/// @notice Emitted when functions are added, replaced or removed to facets
1616
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut);
1717

@@ -72,7 +72,7 @@ contract Diamond is IDiamondCut, ComptrollerV17Storage {
7272
*/
7373
function facetAddress(
7474
bytes4 functionSelector
75-
) external view returns (ComptrollerV17Storage.FacetAddressAndPosition memory) {
75+
) external view returns (ComptrollerV18Storage.FacetAddressAndPosition memory) {
7676
return _selectorToFacetAndPosition[functionSelector];
7777
}
7878

0 commit comments

Comments
 (0)