uups-checker 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +6 -0
- package/AIFI_AUDIT.md +220 -0
- package/ALL_AUDITS_SUMMARY.md +366 -0
- package/ALPHA_PROXY_CRITICAL_FINDING.md +136 -0
- package/ALPHA_PROXY_FINAL_ANALYSIS.md +213 -0
- package/ALPHA_PROXY_FINAL_VERDICT.md +233 -0
- package/ALPHA_PROXY_SELFDESTRUCT_EXPLOIT.md +161 -0
- package/ARIA-foundry-test.txt +9 -0
- package/ARIA-mythril-analysis.txt +20 -0
- package/ARIA-slither-analysis.txt +38 -0
- package/ARIA_AI_SECURITY_AUDIT.md +290 -0
- package/ARIA_VERIFIED_AUDIT.md +259 -0
- package/ARIA_VERIFIED_slither.txt +76 -0
- package/ARIVA_source.txt +1 -0
- package/ARK_AUDIT.md +349 -0
- package/BANANA_AUDIT.md +365 -0
- package/BAS_AUDIT.md +451 -0
- package/BAS_TOKEN_AUDIT.md +235 -0
- package/BCE_EXPLOIT_ANALYSIS.md +165 -0
- package/BEEFY_BNB_CHAIN_ANALYSIS.md +488 -0
- package/BEEFY_MONAD_ANALYSIS.md +239 -0
- package/BEEFY_STAKING_ANALYSIS.md +136 -0
- package/BEEFY_XVS_WBNB_ACTUAL_FINDINGS.md +223 -0
- package/BEEFY_XVS_WBNB_CRITICAL_FINDINGS.md +269 -0
- package/BLOCKSEC_ATTACK_KNOWLEDGE_BASE.md +771 -0
- package/BRISE_ANALYSIS.txt +31 -0
- package/BRISE_BSC_DAPPS.txt +68 -0
- package/BRISE_EXPLOITS_FOUND.md +98 -0
- package/BRISE_REAL_EXPLOITS.md +115 -0
- package/BRISE_WHITEHAT_REPORT.md +162 -0
- package/BRISEstake_Analysis.txt +95 -0
- package/BSCSLOCKTOKEN_CRITICAL_FINDING.md +240 -0
- package/BSW_BISWAP_SECURITY_AUDIT.md +330 -0
- package/BTCST_FINAL_VERDICT.md +319 -0
- package/BTCST_MINING_REBASE_ANALYSIS.md +229 -0
- package/BTCST_ROUNDING_DEEP_DIVE.md +293 -0
- package/BTCST_ROUNDING_FINAL_VERDICT.md +9 -0
- package/BTCST_SECURITY_ANALYSIS.md +391 -0
- package/BTR_AUDIT.md +210 -0
- package/BeamBridge-analysis.md +226 -0
- package/BeamToken-analysis.md +201 -0
- package/BitgertSwap_Investigation.txt +107 -0
- package/CEEK_STAKING_ANALYSIS.md +0 -0
- package/CHAINBASE_AUDIT.md +422 -0
- package/COMPLETE_AUDIT_SUMMARY.md +342 -0
- package/CORRECTED_ANALYSIS.txt +115 -0
- package/DBXEN_COMPARISON_SUMMARY.md +232 -0
- package/DBXEN_EXPLOIT_ANALYSIS.md +530 -0
- package/DOPFairLaunch_raw.json +29 -0
- package/DOPFairLaunch_source.txt +0 -0
- package/DOP_BRIDGE_FINAL_ANALYSIS.txt +86 -0
- package/DOP_BUSD_LP_ANALYSIS.txt +44 -0
- package/DOP_FAIRLAUNCH_ANALYSIS.txt +61 -0
- package/DOP_FAIRLAUNCH_FINAL_VERDICT.txt +113 -0
- package/DOP_STAKING_CONTRACT_ANALYSIS.txt +67 -0
- package/DSYNC_ECOSYSTEM_ANALYSIS.md +221 -0
- package/DSyncStaking-exploit-analysis.md +153 -0
- package/DSyncVault-analysis.md +120 -0
- package/DUSD_PROXY_AUDIT.md +407 -0
- package/DXSALE_LOCK_AUDIT.md +0 -0
- package/DXSaleLock_bytecode.txt +1 -0
- package/ECHIDNA_QUICK_START.md +101 -0
- package/ELEPHANT_ECOSYSTEM_AUDIT_PLAN.md +159 -0
- package/ELEPHANT_ECOSYSTEM_COMPREHENSIVE_AUDIT.md +427 -0
- package/ELEPHANT_SECURITY_ANALYSIS.md +209 -0
- package/ELEPHANT_VULNERABILITIES_EXPLAINED.md +455 -0
- package/EXPLOIT_FIX.md +300 -0
- package/EXPLOIT_INSTRUCTIONS.md +273 -0
- package/EXPLOIT_SUMMARY.md +285 -0
- package/EXPLOIT_SUMMARY.txt +175 -0
- package/FALCON_FINANCE_AUDIT.md +258 -0
- package/FANDOM_AUDIT.md +359 -0
- package/FEE_ON_TRANSFER_ANALYSIS.md +228 -0
- package/FINAL_AUDIT_REPORT.md +0 -0
- package/FOLIO_PROXY_AUDIT.md +299 -0
- package/FOT_EXPLOIT_RESULTS.txt +110 -0
- package/FOT_TOKENS_AUDITED.md +103 -0
- package/HEGIC-mythril-analysis.txt +39 -0
- package/HEGIC_COMPLETE_ANALYSIS.md +343 -0
- package/HOTCROSS_SWAP_EXPLOIT_ANALYSIS.md +123 -0
- package/ICECREAMSWAP_EXPLOITS.md +259 -0
- package/IMMUNEFI_REPORT.md +314 -0
- package/KCCPAD_EXPLOIT_GUIDE.md +285 -0
- package/KEL_CEL_EXPLOIT_ANALYSIS.md +0 -0
- package/KOGE_AUDIT.md +328 -0
- package/LENDFLARE_ANALYSIS.md +239 -0
- package/LENDFLARE_ECHIDNA_GUIDE.md +356 -0
- package/LENDFLARE_EXPLOIT_INSTRUCTIONS.md +297 -0
- package/LENDFLARE_EXPLOIT_SUMMARY.md +292 -0
- package/LENDFLARE_FLASHLOAN_GUIDE.md +383 -0
- package/LENDFLARE_FUZZING_RESULTS.md +252 -0
- package/LENDFLARE_HONEYPOT_BYPASS_ANALYSIS.md +420 -0
- package/LENDFLARE_MANUAL_FUZZING.md +324 -0
- package/LENDFLARE_MYTHRIL_ANALYSIS.md +339 -0
- package/LENDFLARE_V3_BYPASS.md +296 -0
- package/LFTDECOMPILE.txt +14478 -0
- package/LFT_ACCOUNTING_ANALYSIS.md +0 -0
- package/LFT_ACCOUNTING_BUG_ANALYSIS.md +426 -0
- package/LFT_BACKDOOR_DEEP_DIVE.md +0 -0
- package/LFT_CRITICAL_EXPLOIT_CONFIRMED.md +428 -0
- package/LFT_EXPLOIT_VISUAL.md +253 -0
- package/LFT_QUICK_SUMMARY.md +124 -0
- package/LFT_REVERSE_EXPLOIT_ANALYSIS.md +521 -0
- package/MGO_AUDIT_REPORT.md +420 -0
- package/MYTHRIL_FINAL_REPORT.md +306 -0
- package/MYTHRIL_SLITHER_SUMMARY.md +244 -0
- package/NETX_MIGRATION_AUDIT.md +0 -0
- package/NPM_PUBLISH_GUIDE.md +0 -0
- package/NRV_CRITICAL_EXPLOIT.txt +143 -0
- package/NetX_Analysis.txt +76 -0
- package/NetX_Migration_bytecode.txt +1 -0
- package/NetX_Migration_source.txt +0 -0
- package/NetX_Token_source.txt +0 -0
- package/NetxWhitehatRescue +22 -0
- package/OILER_ATTACK_VISUAL.md +351 -0
- package/OILER_BLOCKSEC_TEST_RESULTS.md +421 -0
- package/OILER_DEEP_ANALYSIS.md +212 -0
- package/OILER_FINAL_EXPLOIT_REPORT.md +241 -0
- package/OILER_FINAL_VERDICT.md +339 -0
- package/OILER_REENTRANCY_EXPLAINED.md +638 -0
- package/OILER_REENTRANCY_FINAL_SUMMARY.md +391 -0
- package/OILER_REENTRANCY_REALITY_CHECK.md +393 -0
- package/OILER_REENTRANCY_STEP_BY_STEP.md +597 -0
- package/OILER_STAKING_MAINNET_ANALYSIS.md +366 -0
- package/OILER_STAKING_SECURITY_ANALYSIS.md +409 -0
- package/PANCAKESWAP_UNDERFLOW_HUNTING.md +317 -0
- package/POLS_MULTICHAIN_AUDIT.md +0 -0
- package/POSI_STAKING_AUDIT.md +0 -0
- package/PROXY2_SECURITY_ANALYSIS.md +0 -0
- package/Proxy2TACS +29748 -0
- package/QUICK_START.md +240 -0
- package/RAMP_SECURITY_ANALYSIS.md +0 -0
- package/README.md +238 -0
- package/REAUDIT_MASTER_LIST.txt +15 -0
- package/RING_analysis.txt +212 -0
- package/RPC +4 -0
- package/RULES.txt +20 -0
- package/SIREN_AUDIT.md +186 -0
- package/SYNC_EXPLOIT_README.md +0 -0
- package/SYNC_TOKEN_EXPLOIT_REPORT.md +224 -0
- package/TLM_raw.html +0 -0
- package/TLM_raw.txt +0 -0
- package/TLM_response.json +1 -0
- package/TRADOOR_AUDIT.md +253 -0
- package/TRUNK_AUDIT.md +285 -0
- package/UNIBASE_AUDIT.md +241 -0
- package/UNLOCK_ANALYSIS.md +0 -0
- package/UNLOCK_EXPLOIT.md +49 -0
- package/UNLOCK_EXPLOIT_ANALYSIS.md +0 -0
- package/UPS +232 -0
- package/UUPSCHECKER +208 -0
- package/VAULT_PROXY_AUDIT.md +457 -0
- package/VAULT_PROXY_FINAL_VERDICT.md +0 -0
- package/VERIFIED_EXPLOITS_FINAL.txt +146 -0
- package/WKEYDAO2_AUDIT.md +245 -0
- package/WSG_AUDIT.md +0 -0
- package/XFI_DEEP_ANALYSIS.md +327 -0
- package/YOOSHI_EXPLOIT_GUIDE.md +119 -0
- package/YSDAO_EXPLOIT_GUIDE.md +0 -0
- package/agent-4-bundle.md +22490 -0
- package/alpha-proxy-echidna.txt +1 -0
- package/alpha-proxy-fuzz-results.txt +81 -0
- package/alpha-proxy-mythril.txt +2 -0
- package/analyze-btcst-farm.js +54 -0
- package/analyze-dxsale-lock.js +75 -0
- package/analyze-elephant.js +69 -0
- package/analyze-fara-rewards.js +109 -0
- package/analyze-fara-storage.js +83 -0
- package/analyze-lft-transaction.js +158 -0
- package/analyze-lock-bytecode.js +59 -0
- package/analyze-shegic.js +0 -0
- package/analyze-staking-abi.js +0 -0
- package/analyze-sxp.js +57 -0
- package/analyze-tlm.js +76 -0
- package/analyze-trumpet.js +98 -0
- package/analyze-unlimited-nft.js +108 -0
- package/analyze_elephant.sh +27 -0
- package/analyze_vault.sh +32 -0
- package/aria-bytecode.txt +1 -0
- package/aria_response.json +1 -0
- package/ark_temp/README.md +66 -0
- package/ark_temp/lib/forge-std/.gitattributes +1 -0
- package/ark_temp/lib/forge-std/.github/CODEOWNERS +1 -0
- package/ark_temp/lib/forge-std/.github/dependabot.yml +6 -0
- package/ark_temp/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/ark_temp/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/ark_temp/lib/forge-std/CONTRIBUTING.md +193 -0
- package/ark_temp/lib/forge-std/LICENSE-APACHE +203 -0
- package/ark_temp/lib/forge-std/LICENSE-MIT +25 -0
- package/ark_temp/lib/forge-std/README.md +314 -0
- package/ark_temp/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/ark_temp/lib/forge-std/package.json +16 -0
- package/ark_temp/lib/forge-std/scripts/vm.py +636 -0
- package/audits/AiFi-security-audit-20260326.md +499 -0
- package/audits/BasedAI-Brains-security-audit-20260324.md +651 -0
- package/audits/BinanceAlphaWallet-pashov-ai-audit-report-20260324-170000.md +362 -0
- package/audits/DGToken-security-audit-20260324.md +376 -0
- package/audits/DSyncStaking-audit-part1.md +161 -0
- package/audits/DSyncStaking-security-audit-20260324.md +547 -0
- package/audits/DecompiledERC20-security-audit-20260325.md +397 -0
- package/audits/DegenVC-security-audit-20260324.md +585 -0
- package/audits/DelreyInu-security-audit-20260324.md +463 -0
- package/audits/DestraNetwork-security-audit-20260324.md +705 -0
- package/audits/DomiToken-security-audit-20260324.md +514 -0
- package/audits/LendFlareToken-security-audit-20260325.md +197 -0
- package/audits/LockReleaseTokenPool-security-audit-20260324.md +482 -0
- package/audits/MOG-pashov-ai-audit-report-20260324-164900.md +229 -0
- package/audits/PAALAI-security-audit-20260324.md +475 -0
- package/audits/PAR-security-audit-20260325.md +311 -0
- package/audits/PepeCoinStaking-security-audit-20260324.md +358 -0
- package/audits/StakingPool-security-audit-20260324.md +517 -0
- package/audits/SyncToken-security-audit-20260324.md +778 -0
- package/audits/UndeadToken-decompiled-security-audit-20260324.md +485 -0
- package/audits/UnknownToken-decompiled-security-audit-20260324.md +647 -0
- package/audits/XFIStaking-security-audit-20260324.md +682 -0
- package/audits/Xfinance-security-audit-20260324.md +463 -0
- package/audits/basedAIFarm-security-audit-20260324.md +330 -0
- package/audits/pepeCoin-security-audit-20260324.md +462 -0
- package/bin/ups +232 -0
- package/binance-wallet-exploit/.env.example +2 -0
- package/binance-wallet-exploit/EXECUTIVE_SUMMARY.md +272 -0
- package/binance-wallet-exploit/EXPLOIT_SUMMARY.md +104 -0
- package/binance-wallet-exploit/FINAL_ANALYSIS.md +326 -0
- package/binance-wallet-exploit/FLASHLOAN_ATTACK.md +292 -0
- package/binance-wallet-exploit/HONEYPOT_REPORT.md +526 -0
- package/binance-wallet-exploit/INVESTIGATION_COMPLETE.md +362 -0
- package/binance-wallet-exploit/LENDFLARE_EXPLOIT.md +219 -0
- package/binance-wallet-exploit/LENDFLARE_FINAL_ATTACK.md +307 -0
- package/binance-wallet-exploit/LENDFLARE_REAL_EXPLOIT.md +286 -0
- package/binance-wallet-exploit/LENDFLARE_RUGPULL.md +269 -0
- package/binance-wallet-exploit/LFT_ANALYSIS.md +206 -0
- package/binance-wallet-exploit/QUICK_START.md +75 -0
- package/binance-wallet-exploit/README.md +195 -0
- package/binance-wallet-exploit/REAL_TX_EXPLOIT_ANALYSIS.md +271 -0
- package/binance-wallet-exploit/REMIX_INSTRUCTIONS.md +223 -0
- package/binance-wallet-exploit/TEST_RESULTS.md +203 -0
- package/binance-wallet-exploit/cache/solidity-files-cache.json +1 -0
- package/binance-wallet-exploit/cache/test-failures +1 -0
- package/binance-wallet-exploit/lib/forge-std/.gitattributes +1 -0
- package/binance-wallet-exploit/lib/forge-std/.github/CODEOWNERS +1 -0
- package/binance-wallet-exploit/lib/forge-std/.github/dependabot.yml +6 -0
- package/binance-wallet-exploit/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/binance-wallet-exploit/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/binance-wallet-exploit/lib/forge-std/CONTRIBUTING.md +193 -0
- package/binance-wallet-exploit/lib/forge-std/LICENSE-APACHE +203 -0
- package/binance-wallet-exploit/lib/forge-std/LICENSE-MIT +25 -0
- package/binance-wallet-exploit/lib/forge-std/README.md +314 -0
- package/binance-wallet-exploit/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/binance-wallet-exploit/lib/forge-std/package.json +16 -0
- package/binance-wallet-exploit/lib/forge-std/scripts/vm.py +636 -0
- package/binance-wallet-exploit/out/build-info/1e9aa7e86cf56962.json +1 -0
- package/binance-wallet-exploit/out/build-info/6f56f10e9d7b56eb.json +1 -0
- package/binance-wallet-exploit/out/build-info/7edba961ff697a24.json +1 -0
- package/binance-wallet-exploit/out/build-info/8c27fe3efea2f2e7.json +1 -0
- package/binance-wallet-exploit/out/build-info/978b680daffec63a.json +1 -0
- package/binance-wallet-exploit/out/build-info/9806b900b5672d0c.json +1 -0
- package/binance-wallet-exploit/out/build-info/b4b9ff36e9b3fc27.json +1 -0
- package/binance-wallet-exploit/out/build-info/b6f4df9ae05c0812.json +1 -0
- package/binance-wallet-exploit/out/build-info/c88dbc86551f7b5c.json +1 -0
- package/binance-wallet-exploit/out/build-info/e9657504010623db.json +1 -0
- package/cache/fuzz/failures/ARIAVerifiedFuzzTest/testFuzz_ApprovalRaceCondition +1 -0
- package/cache/fuzz/failures/HotCrossSwapFuzzTest/testFuzz_DirectTransferExploit +1 -0
- package/cache/fuzz/failures/HotCrossSwapFuzzTest/testFuzz_LargeSwapDrain +1 -0
- package/cache/fuzz/failures/LendFlareFuzz/testFuzz_ApprovalExploit +1 -0
- package/cache/fuzz/failures/LendFlareFuzz/testFuzz_BalanceManipulation +1 -0
- package/cache/fuzz/failures/LendFlareFuzz/testFuzz_RateManipulation +1 -0
- package/cache/fuzz/failures/LendFlareFuzz/testFuzz_StorageManipulation +1 -0
- package/cache/fuzz/failures/PARFuzzTest/testFuzz_OverflowTransfer +1 -0
- package/cache/fuzz/failures/PARFuzzTest/testFuzz_Transfer +1 -0
- package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_FrontrunAddfunds +1 -0
- package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_RewardOverflow +1 -0
- package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_RoundingExploit +1 -0
- package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_WithdrawLimit +1 -0
- package/cache/solidity-files-cache.json +1 -0
- package/cache/test-failures +1 -0
- package/calculate-elephant-flashloan.js +195 -0
- package/check-address-approval.js +112 -0
- package/check-alpha-proxy.js +42 -0
- package/check-arbitrage.js +155 -0
- package/check-aria-token.js +47 -0
- package/check-ark.sh +20 -0
- package/check-btcst-mining.js +75 -0
- package/check-btcst-pools.js +163 -0
- package/check-btcst.js +88 -0
- package/check-caller.js +26 -0
- package/check-ceek-lp.js +73 -0
- package/check-ceek.js +47 -0
- package/check-dxsale-address.js +35 -0
- package/check-fara-exploit-timing.js +56 -0
- package/check-fara-real-exploit.js +73 -0
- package/check-flashloan-limits.js +129 -0
- package/check-kel-cel-pool.js +91 -0
- package/check-lax-staking.js +41 -0
- package/check-lendflare.js +165 -0
- package/check-lft-accounting.js +109 -0
- package/check-lft-roles.js +165 -0
- package/check-lock-time.js +47 -0
- package/check-min-stake.js +73 -0
- package/check-mystery-contract.js +52 -0
- package/check-next-token.js +50 -0
- package/check-nora-lock.js +67 -0
- package/check-oiler-approvals.js +116 -0
- package/check-oiler-proxy.js +73 -0
- package/check-oiler-staking.js +117 -0
- package/check-proxy-simple.js +71 -0
- package/check-recent-stakes.js +54 -0
- package/check-shegic-holdings.js +67 -0
- package/check-snowcrash-ecosystem.js +83 -0
- package/check-sync-lp.js +97 -0
- package/check-sync-stake.js +42 -0
- package/check-tlm.js +37 -0
- package/check-token-pools.js +146 -0
- package/check-trunk-depeg.js +181 -0
- package/check-tusd-decimals.js +58 -0
- package/check-user-storage-deep.js +81 -0
- package/check-welephant-pools.js +130 -0
- package/check-xfi-pool.js +75 -0
- package/check-zypher.js +32 -0
- package/check_proxy.sh +36 -0
- package/compare-tlm-chains.js +90 -0
- package/contract_0x05f2.html +6025 -0
- package/contract_0x3720.html +6361 -0
- package/contract_0x928e.html +5606 -0
- package/contract_0xc42d.html +5304 -0
- package/contract_page.html +5789 -0
- package/decode-stake-tx.js +50 -0
- package/deep-analyze-lock.js +82 -0
- package/dune_uups_proxy_query.sql +42 -0
- package/dune_uups_vulnerable_query.sql +0 -0
- package/echidna/alpha-proxy.yaml +14 -0
- package/echidna/elephant.yaml +7 -0
- package/echidna/lendflare.yaml +42 -0
- package/echidna.config.yaml +12 -0
- package/elephant_raw.json +1 -0
- package/eps_raw.json +1 -0
- package/exploit/.github/workflows/test.yml +38 -0
- package/exploit/.gitmodules +3 -0
- package/exploit/README.md +66 -0
- package/exploit/foundry.lock +8 -0
- package/exploit/lib/forge-std/.gitattributes +1 -0
- package/exploit/lib/forge-std/.github/CODEOWNERS +1 -0
- package/exploit/lib/forge-std/.github/dependabot.yml +6 -0
- package/exploit/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/exploit/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/exploit/lib/forge-std/CONTRIBUTING.md +193 -0
- package/exploit/lib/forge-std/LICENSE-APACHE +203 -0
- package/exploit/lib/forge-std/LICENSE-MIT +25 -0
- package/exploit/lib/forge-std/README.md +314 -0
- package/exploit/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/exploit/lib/forge-std/package.json +16 -0
- package/exploit/lib/forge-std/scripts/vm.py +636 -0
- package/exploit_analysis.txt +51 -0
- package/extract_contract.py +21 -0
- package/extract_elephant_contracts.py +24 -0
- package/fara-staking-bytecode.txt +1 -0
- package/fara-staking-raw.txt +1 -0
- package/fetch-aria.js +46 -0
- package/fetch-contract.js +50 -0
- package/fetch-shegic-source.js +86 -0
- package/fetch-snowcrash.js +44 -0
- package/fetch-staking-source.js +53 -0
- package/fetch-tlm.js +60 -0
- package/fetch_elephant_source.py +32 -0
- package/find-ceek-staking.js +21 -0
- package/find-exploit-tx.js +88 -0
- package/find-oiler-holders.js +100 -0
- package/find-tlm-holder.js +36 -0
- package/find-vulnerable-fund.js +94 -0
- package/foundry.lock +8 -0
- package/fuzz-all.sh +53 -0
- package/get-aria-contract.py +40 -0
- package/get-lft-holders.js +89 -0
- package/get-tlm-source.sh +8 -0
- package/harvest_txs.json +1 -0
- package/lft-bytecode-raw.txt +1 -0
- package/lft-bytecode.json +1 -0
- package/lft-impl.bin +1 -0
- package/lft-implementation-bytecode.txt +1 -0
- package/lib/forge-std/.gitattributes +1 -0
- package/lib/forge-std/.github/CODEOWNERS +1 -0
- package/lib/forge-std/.github/dependabot.yml +6 -0
- package/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/lib/forge-std/CONTRIBUTING.md +193 -0
- package/lib/forge-std/LICENSE-APACHE +203 -0
- package/lib/forge-std/LICENSE-MIT +25 -0
- package/lib/forge-std/README.md +314 -0
- package/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/lib/forge-std/package.json +16 -0
- package/lib/forge-std/scripts/vm.py +636 -0
- package/lib/openzeppelin-contracts/.changeset/config.json +12 -0
- package/lib/openzeppelin-contracts/.codecov.yml +12 -0
- package/lib/openzeppelin-contracts/.editorconfig +21 -0
- package/lib/openzeppelin-contracts/.eslintrc +20 -0
- package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
- package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml +4 -0
- package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
- package/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- package/lib/openzeppelin-contracts/.github/actions/gas-compare/action.yml +49 -0
- package/lib/openzeppelin-contracts/.github/actions/setup/action.yml +21 -0
- package/lib/openzeppelin-contracts/.github/actions/storage-layout/action.yml +55 -0
- package/lib/openzeppelin-contracts/.github/workflows/actionlint.yml +18 -0
- package/lib/openzeppelin-contracts/.github/workflows/changeset.yml +28 -0
- package/lib/openzeppelin-contracts/.github/workflows/checks.yml +118 -0
- package/lib/openzeppelin-contracts/.github/workflows/docs.yml +19 -0
- package/lib/openzeppelin-contracts/.github/workflows/formal-verification.yml +68 -0
- package/lib/openzeppelin-contracts/.github/workflows/release-cycle.yml +214 -0
- package/lib/openzeppelin-contracts/.github/workflows/upgradeable.yml +34 -0
- package/lib/openzeppelin-contracts/.gitmodules +7 -0
- package/lib/openzeppelin-contracts/.mocharc.js +4 -0
- package/lib/openzeppelin-contracts/.prettierrc +15 -0
- package/lib/openzeppelin-contracts/.solcover.js +13 -0
- package/lib/openzeppelin-contracts/CHANGELOG.md +972 -0
- package/lib/openzeppelin-contracts/CODE_OF_CONDUCT.md +73 -0
- package/lib/openzeppelin-contracts/CONTRIBUTING.md +36 -0
- package/lib/openzeppelin-contracts/GUIDELINES.md +148 -0
- package/lib/openzeppelin-contracts/LICENSE +22 -0
- package/lib/openzeppelin-contracts/README.md +107 -0
- package/lib/openzeppelin-contracts/RELEASING.md +45 -0
- package/lib/openzeppelin-contracts/SECURITY.md +42 -0
- package/lib/openzeppelin-contracts/audits/2017-03.md +292 -0
- package/lib/openzeppelin-contracts/audits/2018-10.pdf +0 -0
- package/lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf +0 -0
- package/lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf +0 -0
- package/lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf +0 -0
- package/lib/openzeppelin-contracts/audits/2023-10-v5.0.pdf +0 -0
- package/lib/openzeppelin-contracts/audits/README.md +17 -0
- package/lib/openzeppelin-contracts/certora/Makefile +54 -0
- package/lib/openzeppelin-contracts/certora/README.md +60 -0
- package/lib/openzeppelin-contracts/certora/diff/access_manager_AccessManager.sol.patch +97 -0
- package/lib/openzeppelin-contracts/certora/reports/2021-10.pdf +0 -0
- package/lib/openzeppelin-contracts/certora/reports/2022-03.pdf +0 -0
- package/lib/openzeppelin-contracts/certora/reports/2022-05.pdf +0 -0
- package/lib/openzeppelin-contracts/certora/run.js +160 -0
- package/lib/openzeppelin-contracts/certora/specs/AccessControl.spec +119 -0
- package/lib/openzeppelin-contracts/certora/specs/AccessControlDefaultAdminRules.spec +464 -0
- package/lib/openzeppelin-contracts/certora/specs/DoubleEndedQueue.spec +300 -0
- package/lib/openzeppelin-contracts/certora/specs/ERC20.spec +352 -0
- package/lib/openzeppelin-contracts/certora/specs/ERC20FlashMint.spec +55 -0
- package/lib/openzeppelin-contracts/certora/specs/ERC20Wrapper.spec +198 -0
- package/lib/openzeppelin-contracts/certora/specs/ERC721.spec +679 -0
- package/lib/openzeppelin-contracts/certora/specs/EnumerableMap.spec +333 -0
- package/lib/openzeppelin-contracts/certora/specs/EnumerableSet.spec +246 -0
- package/lib/openzeppelin-contracts/certora/specs/Initializable.spec +165 -0
- package/lib/openzeppelin-contracts/certora/specs/Ownable.spec +77 -0
- package/lib/openzeppelin-contracts/certora/specs/Ownable2Step.spec +108 -0
- package/lib/openzeppelin-contracts/certora/specs/Pausable.spec +96 -0
- package/lib/openzeppelin-contracts/certora/specs/TimelockController.spec +274 -0
- package/lib/openzeppelin-contracts/certora/specs/helpers/helpers.spec +7 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IAccessControl.spec +8 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IAccessControlDefaultAdminRules.spec +36 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC20.spec +11 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC2612.spec +5 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashBorrower.spec +3 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashLender.spec +5 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC5313.spec +3 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC721.spec +17 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IERC721Receiver.spec +3 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IOwnable.spec +5 -0
- package/lib/openzeppelin-contracts/certora/specs/methods/IOwnable2Step.spec +7 -0
- package/lib/openzeppelin-contracts/certora/specs.json +86 -0
- package/lib/openzeppelin-contracts/contracts/access/README.adoc +43 -0
- package/lib/openzeppelin-contracts/contracts/finance/README.adoc +14 -0
- package/lib/openzeppelin-contracts/contracts/governance/README.adoc +167 -0
- package/lib/openzeppelin-contracts/contracts/interfaces/README.adoc +82 -0
- package/lib/openzeppelin-contracts/contracts/metatx/README.adoc +12 -0
- package/lib/openzeppelin-contracts/contracts/package.json +32 -0
- package/lib/openzeppelin-contracts/contracts/proxy/README.adoc +87 -0
- package/lib/openzeppelin-contracts/contracts/token/ERC1155/README.adoc +41 -0
- package/lib/openzeppelin-contracts/contracts/token/ERC20/README.adoc +67 -0
- package/lib/openzeppelin-contracts/contracts/token/ERC721/README.adoc +67 -0
- package/lib/openzeppelin-contracts/contracts/token/common/README.adoc +10 -0
- package/lib/openzeppelin-contracts/contracts/utils/README.adoc +88 -0
- package/lib/openzeppelin-contracts/contracts/vendor/compound/LICENSE +11 -0
- package/lib/openzeppelin-contracts/docs/README.md +16 -0
- package/lib/openzeppelin-contracts/docs/antora.yml +7 -0
- package/lib/openzeppelin-contracts/docs/config.js +21 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +23 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +204 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/backwards-compatibility.adoc +48 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/crowdsales.adoc +11 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/drafts.adoc +19 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +145 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +71 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +77 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +214 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +79 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +77 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/faq.adoc +13 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +240 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +79 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +31 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +77 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +185 -0
- package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc +15 -0
- package/lib/openzeppelin-contracts/docs/templates/contract.hbs +111 -0
- package/lib/openzeppelin-contracts/docs/templates/helpers.js +46 -0
- package/lib/openzeppelin-contracts/docs/templates/page.hbs +4 -0
- package/lib/openzeppelin-contracts/docs/templates/properties.js +64 -0
- package/lib/openzeppelin-contracts/hardhat/env-artifacts.js +24 -0
- package/lib/openzeppelin-contracts/hardhat/env-contract.js +25 -0
- package/lib/openzeppelin-contracts/hardhat/ignore-unreachable-warnings.js +45 -0
- package/lib/openzeppelin-contracts/hardhat/skip-foundry-tests.js +6 -0
- package/lib/openzeppelin-contracts/hardhat/task-test-get-files.js +25 -0
- package/lib/openzeppelin-contracts/hardhat.config.js +131 -0
- package/lib/openzeppelin-contracts/lib/erc4626-tests/LICENSE +661 -0
- package/lib/openzeppelin-contracts/lib/erc4626-tests/README.md +116 -0
- package/lib/openzeppelin-contracts/lib/forge-std/.github/workflows/ci.yml +92 -0
- package/lib/openzeppelin-contracts/lib/forge-std/.gitmodules +3 -0
- package/lib/openzeppelin-contracts/lib/forge-std/LICENSE-APACHE +203 -0
- package/lib/openzeppelin-contracts/lib/forge-std/LICENSE-MIT +25 -0
- package/lib/openzeppelin-contracts/lib/forge-std/README.md +250 -0
- package/lib/openzeppelin-contracts/lib/forge-std/package.json +16 -0
- package/lib/openzeppelin-contracts/logo.svg +15 -0
- package/lib/openzeppelin-contracts/netlify.toml +3 -0
- package/lib/openzeppelin-contracts/package-lock.json +16544 -0
- package/lib/openzeppelin-contracts/package.json +96 -0
- package/lib/openzeppelin-contracts/remappings.txt +1 -0
- package/lib/openzeppelin-contracts/renovate.json +4 -0
- package/lib/openzeppelin-contracts/requirements.txt +1 -0
- package/lib/openzeppelin-contracts/scripts/checks/compare-layout.js +20 -0
- package/lib/openzeppelin-contracts/scripts/checks/compareGasReports.js +243 -0
- package/lib/openzeppelin-contracts/scripts/checks/extract-layout.js +38 -0
- package/lib/openzeppelin-contracts/scripts/checks/generation.sh +6 -0
- package/lib/openzeppelin-contracts/scripts/checks/inheritance-ordering.js +54 -0
- package/lib/openzeppelin-contracts/scripts/gen-nav.js +41 -0
- package/lib/openzeppelin-contracts/scripts/generate/format-lines.js +16 -0
- package/lib/openzeppelin-contracts/scripts/generate/run.js +49 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.js +247 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.opts.js +17 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.t.js +146 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableMap.js +283 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableSet.js +250 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/SafeCast.js +126 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/StorageSlot.js +78 -0
- package/lib/openzeppelin-contracts/scripts/generate/templates/conversion.js +30 -0
- package/lib/openzeppelin-contracts/scripts/git-user-config.sh +6 -0
- package/lib/openzeppelin-contracts/scripts/helpers.js +37 -0
- package/lib/openzeppelin-contracts/scripts/prepack.sh +23 -0
- package/lib/openzeppelin-contracts/scripts/prepare-docs.sh +26 -0
- package/lib/openzeppelin-contracts/scripts/release/format-changelog.js +33 -0
- package/lib/openzeppelin-contracts/scripts/release/synchronize-versions.js +15 -0
- package/lib/openzeppelin-contracts/scripts/release/update-comment.js +34 -0
- package/lib/openzeppelin-contracts/scripts/release/version.sh +11 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/exit-prerelease.sh +8 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/github-release.js +48 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/integrity-check.sh +20 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/pack.sh +26 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/publish.sh +26 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/rerun.js +7 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/set-changesets-pr-title.js +17 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/start.sh +35 -0
- package/lib/openzeppelin-contracts/scripts/release/workflow/state.js +112 -0
- package/lib/openzeppelin-contracts/scripts/remove-ignored-artifacts.js +45 -0
- package/lib/openzeppelin-contracts/scripts/solhint-custom/index.js +84 -0
- package/lib/openzeppelin-contracts/scripts/solhint-custom/package.json +5 -0
- package/lib/openzeppelin-contracts/scripts/update-docs-branch.js +65 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/README.md +21 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/patch-apply.sh +19 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/patch-save.sh +18 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/transpile-onto.sh +54 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/transpile.sh +47 -0
- package/lib/openzeppelin-contracts/scripts/upgradeable/upgradeable.patch +360 -0
- package/lib/openzeppelin-contracts/slither.config.json +5 -0
- package/lib/openzeppelin-contracts/solhint.config.js +20 -0
- package/mythril-lft-output.txt +1 -0
- package/mythril-lft-symbolic.txt +18 -0
- package/mythril-lft.sh +20 -0
- package/mythril-symbolic-output.txt +1 -0
- package/mythril-symbolic.sh +42 -0
- package/out/build-info/0026b78428192979.json +1 -0
- package/out/build-info/03c4fc3b88486eba.json +1 -0
- package/out/build-info/0540afa9b9a5c5a6.json +1 -0
- package/out/build-info/081932f505bc08b9.json +1 -0
- package/out/build-info/0da104ba0d6642d5.json +1 -0
- package/out/build-info/197281971dbb5f23.json +1 -0
- package/out/build-info/197e7e332832a232.json +1 -0
- package/out/build-info/1a1cab9136eb5f94.json +1 -0
- package/out/build-info/1b320204eb162aa2.json +1 -0
- package/out/build-info/1e03f94398052674.json +1 -0
- package/out/build-info/22ac085949602937.json +1 -0
- package/out/build-info/234ef37453a9fa64.json +1 -0
- package/out/build-info/2447db7b1878fa8e.json +1 -0
- package/out/build-info/25568daeb484f5ff.json +1 -0
- package/out/build-info/27465853244c49ce.json +1 -0
- package/out/build-info/2c57a9e0f087453b.json +1 -0
- package/out/build-info/3c62ae7de8da68c4.json +1 -0
- package/out/build-info/3e771ae109e97bb3.json +1 -0
- package/out/build-info/460499bc0a3465c4.json +1 -0
- package/out/build-info/47ce37e50a4f115e.json +1 -0
- package/out/build-info/4fcce5c63cf427d6.json +1 -0
- package/out/build-info/4fd0a53fe63fddbb.json +1 -0
- package/out/build-info/50f1247db9d769cc.json +1 -0
- package/out/build-info/5317d0181a7a5e02.json +1 -0
- package/out/build-info/594df509275ceb5b.json +1 -0
- package/out/build-info/61983ac3f6141719.json +1 -0
- package/out/build-info/638c4548307122fe.json +1 -0
- package/out/build-info/67c2c43bdb7c0ded.json +1 -0
- package/out/build-info/777f42643aad37b7.json +1 -0
- package/out/build-info/7d7856f19e845354.json +1 -0
- package/out/build-info/83976260b6f71e94.json +1 -0
- package/out/build-info/83c23882000b963d.json +1 -0
- package/out/build-info/84b2cce8f70b36be.json +1 -0
- package/out/build-info/8bc13d31d7c3206a.json +1 -0
- package/out/build-info/8e183bd4d9d8cf88.json +1 -0
- package/out/build-info/94bfe1e7cafa8ff5.json +1 -0
- package/out/build-info/99ec7d5e8d8ff360.json +1 -0
- package/out/build-info/9ac044b29daa7d5e.json +1 -0
- package/out/build-info/9b203227ff5d2e63.json +1 -0
- package/out/build-info/9d18c5872c4282dd.json +1 -0
- package/out/build-info/9f77f04f33baf9a3.json +1 -0
- package/out/build-info/a6e1caf974787982.json +1 -0
- package/out/build-info/a94b6348867a62d6.json +1 -0
- package/out/build-info/ad93721947a8b195.json +1 -0
- package/out/build-info/b42daddb5aa4b19f.json +1 -0
- package/out/build-info/bf13512ae899f7e8.json +1 -0
- package/out/build-info/c39f86c20a548c4a.json +1 -0
- package/out/build-info/cb12bb975a2f4e65.json +1 -0
- package/out/build-info/d0c6788fadc2aa60.json +1 -0
- package/out/build-info/d2726bf94ed5b845.json +1 -0
- package/out/build-info/d4eb00da50cce5cb.json +1 -0
- package/out/build-info/db931924a3bc8bdd.json +1 -0
- package/out/build-info/e1a503d49bc77401.json +1 -0
- package/out/build-info/efe5396f8892ce77.json +1 -0
- package/out/build-info/f536d90ced745969.json +1 -0
- package/out/build-info/fed38823c7019b82.json +1 -0
- package/package.json +51 -0
- package/page.html +5384 -0
- package/pancakeswap-simple-tvl.sql +15 -0
- package/pancakeswap-top-pools.sql +29 -0
- package/pancakeswap-tvl-optimized.sql +57 -0
- package/pancakeswap-tvl-query.sql +60 -0
- package/pancakeswap-underflow-hunting.sql +51 -0
- package/pancakeswap-vulnerability-queries.sql +200 -0
- package/posi_page.html +6369 -0
- package/posi_response.json +29 -0
- package/proxy_page.html +500 -0
- package/run_mythril_elephant.sh +18 -0
- package/sHEGIC-bytecode.bin +6 -0
- package/sHEGIC-mythril-analysis.txt +1 -0
- package/sHEGIC-mythril-full.txt +134 -0
- package/sHEGIC_ANALYSIS.md +135 -0
- package/sHEGIC_EXPLOIT_ANALYSIS.md +317 -0
- package/sHEGIC_MYTHRIL_ANALYSIS.md +361 -0
- package/scrape-snowcrash.js +28 -0
- package/scripts/yooshi_drain.sh +154 -0
- package/shi_raw.json +1 -0
- package/temp.json +1 -0
- package/temp_harvest.json +1 -0
- package/temp_pika.json +1 -0
- package/temp_posi.json +1 -0
- package/temp_response.json +1 -0
- package/test-lft-hidden-balance.js +108 -0
- package/test-xfi-exploit.js +140 -0
- package/trunk-liquidity-rescue.js +164 -0
- package/vBABY_page.html +6153 -0
- package/vBABY_response.json +29 -0
- package/wsg_response.json +1 -0
- package/yooldo_page.html +10371 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const { readFileSync } = require('fs');
|
|
2
|
+
const { join } = require('path');
|
|
3
|
+
const { version } = require(join(__dirname, '../../../package.json'));
|
|
4
|
+
|
|
5
|
+
module.exports = async ({ github, context }) => {
|
|
6
|
+
const changelog = readFileSync('CHANGELOG.md', 'utf8');
|
|
7
|
+
|
|
8
|
+
await github.rest.repos.createRelease({
|
|
9
|
+
owner: context.repo.owner,
|
|
10
|
+
repo: context.repo.repo,
|
|
11
|
+
tag_name: `v${version}`,
|
|
12
|
+
target_commitish: github.ref_name,
|
|
13
|
+
body: extractSection(changelog, version),
|
|
14
|
+
prerelease: process.env.PRERELEASE === 'true',
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// From https://github.com/frangio/extract-changelog/blob/master/src/utils/word-regexp.ts
|
|
19
|
+
function makeWordRegExp(word) {
|
|
20
|
+
const start = word.length > 0 && /\b/.test(word[0]) ? '\\b' : '';
|
|
21
|
+
const end = word.length > 0 && /\b/.test(word[word.length - 1]) ? '\\b' : '';
|
|
22
|
+
return new RegExp(start + [...word].map(c => (/[a-z0-9]/i.test(c) ? c : '\\' + c)).join('') + end);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// From https://github.com/frangio/extract-changelog/blob/master/src/core.ts
|
|
26
|
+
function extractSection(document, wantedHeading) {
|
|
27
|
+
// ATX Headings as defined in GitHub Flavored Markdown (https://github.github.com/gfm/#atx-headings)
|
|
28
|
+
const heading = /^ {0,3}(?<lead>#{1,6})(?: [ \t\v\f]*(?<text>.*?)[ \t\v\f]*)?(?:[\n\r]+|$)/gm;
|
|
29
|
+
|
|
30
|
+
const wantedHeadingRe = makeWordRegExp(wantedHeading);
|
|
31
|
+
|
|
32
|
+
let start, end;
|
|
33
|
+
|
|
34
|
+
for (const m of document.matchAll(heading)) {
|
|
35
|
+
if (!start) {
|
|
36
|
+
if (m.groups.text.search(wantedHeadingRe) === 0) {
|
|
37
|
+
start = m;
|
|
38
|
+
}
|
|
39
|
+
} else if (m.groups.lead.length <= start.groups.lead.length) {
|
|
40
|
+
end = m;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (start) {
|
|
46
|
+
return document.slice(start.index + start[0].length, end?.index);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
CHECKSUMS="$RUNNER_TEMP/checksums.txt"
|
|
6
|
+
|
|
7
|
+
# Extract tarball content into a tmp directory
|
|
8
|
+
tar xf "$TARBALL" -C "$RUNNER_TEMP"
|
|
9
|
+
|
|
10
|
+
# Move to extracted directory
|
|
11
|
+
cd "$RUNNER_TEMP/package"
|
|
12
|
+
|
|
13
|
+
# Checksum all Solidity files
|
|
14
|
+
find . -type f -name "*.sol" | xargs shasum > "$CHECKSUMS"
|
|
15
|
+
|
|
16
|
+
# Back to directory with git contents
|
|
17
|
+
cd "$GITHUB_WORKSPACE/contracts"
|
|
18
|
+
|
|
19
|
+
# Check against tarball contents
|
|
20
|
+
shasum -c "$CHECKSUMS"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
dist_tag() {
|
|
6
|
+
PACKAGE_JSON_NAME="$(jq -r .name ./package.json)"
|
|
7
|
+
LATEST_NPM_VERSION="$(npm info "$PACKAGE_JSON_NAME" version)"
|
|
8
|
+
PACKAGE_JSON_VERSION="$(jq -r .version ./package.json)"
|
|
9
|
+
|
|
10
|
+
if [ "$PRERELEASE" = "true" ]; then
|
|
11
|
+
echo "next"
|
|
12
|
+
elif npx semver -r ">$LATEST_NPM_VERSION" "$PACKAGE_JSON_VERSION" > /dev/null; then
|
|
13
|
+
echo "latest"
|
|
14
|
+
else
|
|
15
|
+
# This is a patch for an older version
|
|
16
|
+
# npm can't publish without a tag
|
|
17
|
+
echo "tmp"
|
|
18
|
+
fi
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
cd contracts
|
|
22
|
+
TARBALL="$(npm pack | tee /dev/stderr | tail -1)"
|
|
23
|
+
echo "tarball_name=$TARBALL" >> $GITHUB_OUTPUT
|
|
24
|
+
echo "tarball=$(pwd)/$TARBALL" >> $GITHUB_OUTPUT
|
|
25
|
+
echo "tag=$(dist_tag)" >> $GITHUB_OUTPUT
|
|
26
|
+
cd ..
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
PACKAGE_JSON_NAME="$(tar xfO "$TARBALL" package/package.json | jq -r .name)"
|
|
6
|
+
PACKAGE_JSON_VERSION="$(tar xfO "$TARBALL" package/package.json | jq -r .version)"
|
|
7
|
+
|
|
8
|
+
# Intentionally escape $ to avoid interpolation and writing the token to disk
|
|
9
|
+
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
|
|
10
|
+
|
|
11
|
+
# Actual publish
|
|
12
|
+
npm publish "$TARBALL" --tag "$TAG"
|
|
13
|
+
|
|
14
|
+
# Clean up tags
|
|
15
|
+
delete_tag() {
|
|
16
|
+
npm dist-tag rm "$PACKAGE_JSON_NAME" "$1"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if [ "$TAG" = tmp ]; then
|
|
20
|
+
delete_tag "$TAG"
|
|
21
|
+
elif [ "$TAG" = latest ]; then
|
|
22
|
+
# Delete the next tag if it exists and is a prerelease for what is currently being published
|
|
23
|
+
if npm dist-tag ls "$PACKAGE_JSON_NAME" | grep -q "next: $PACKAGE_JSON_VERSION"; then
|
|
24
|
+
delete_tag next
|
|
25
|
+
fi
|
|
26
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { coerce, inc, rsort } = require('semver');
|
|
2
|
+
const { join } = require('path');
|
|
3
|
+
const { version } = require(join(__dirname, '../../../package.json'));
|
|
4
|
+
|
|
5
|
+
module.exports = async ({ core }) => {
|
|
6
|
+
// Variables not in the context
|
|
7
|
+
const refName = process.env.GITHUB_REF_NAME;
|
|
8
|
+
|
|
9
|
+
// Compare package.json version's next patch vs. first version patch
|
|
10
|
+
// A recently opened branch will give the next patch for the previous minor
|
|
11
|
+
// So, we get the max against the patch 0 of the release branch's version
|
|
12
|
+
const branchPatch0 = coerce(refName.replace('release-v', '')).version;
|
|
13
|
+
const packageJsonNextPatch = inc(version, 'patch');
|
|
14
|
+
const [nextVersion] = rsort([branchPatch0, packageJsonNextPatch], false);
|
|
15
|
+
|
|
16
|
+
core.exportVariable('TITLE', `Release v${nextVersion}`);
|
|
17
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
# Set changeset status location
|
|
6
|
+
# This is needed because `changeset status --output` only works with relative routes
|
|
7
|
+
CHANGESETS_STATUS_JSON="$(realpath --relative-to=. "$RUNNER_TEMP/status.json")"
|
|
8
|
+
|
|
9
|
+
# Save changeset status to temp file
|
|
10
|
+
npx changeset status --output="$CHANGESETS_STATUS_JSON"
|
|
11
|
+
|
|
12
|
+
# Defensive assertion. SHOULD NOT BE REACHED
|
|
13
|
+
if [ "$(jq '.releases | length' "$CHANGESETS_STATUS_JSON")" != 1 ]; then
|
|
14
|
+
echo "::error file=$CHANGESETS_STATUS_JSON::The status doesn't contain only 1 release"
|
|
15
|
+
exit 1;
|
|
16
|
+
fi;
|
|
17
|
+
|
|
18
|
+
# Create branch
|
|
19
|
+
BRANCH_SUFFIX="$(jq -r '.releases[0].newVersion | gsub("\\.\\d+$"; "")' $CHANGESETS_STATUS_JSON)"
|
|
20
|
+
RELEASE_BRANCH="release-v$BRANCH_SUFFIX"
|
|
21
|
+
git checkout -b "$RELEASE_BRANCH"
|
|
22
|
+
|
|
23
|
+
# Output branch
|
|
24
|
+
echo "branch=$RELEASE_BRANCH" >> $GITHUB_OUTPUT
|
|
25
|
+
|
|
26
|
+
# Enter in prerelease state
|
|
27
|
+
npx changeset pre enter rc
|
|
28
|
+
git add .
|
|
29
|
+
git commit -m "Start release candidate"
|
|
30
|
+
|
|
31
|
+
# Push branch
|
|
32
|
+
if ! git push origin "$RELEASE_BRANCH"; then
|
|
33
|
+
echo "::error file=scripts/release/start.sh::Can't push $RELEASE_BRANCH. Did you forget to run this workflow from $RELEASE_BRANCH?"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const { readPreState } = require('@changesets/pre');
|
|
2
|
+
const { default: readChangesets } = require('@changesets/read');
|
|
3
|
+
const { join } = require('path');
|
|
4
|
+
const { fetch } = require('undici');
|
|
5
|
+
const { version, name: packageName } = require(join(__dirname, '../../../contracts/package.json'));
|
|
6
|
+
|
|
7
|
+
module.exports = async ({ github, context, core }) => {
|
|
8
|
+
const state = await getState({ github, context, core });
|
|
9
|
+
|
|
10
|
+
function setOutput(key, value) {
|
|
11
|
+
core.info(`State ${key} = ${value}`);
|
|
12
|
+
core.setOutput(key, value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Jobs to trigger
|
|
16
|
+
setOutput('start', shouldRunStart(state));
|
|
17
|
+
setOutput('promote', shouldRunPromote(state));
|
|
18
|
+
setOutput('changesets', shouldRunChangesets(state));
|
|
19
|
+
setOutput('publish', shouldRunPublish(state));
|
|
20
|
+
setOutput('merge', shouldRunMerge(state));
|
|
21
|
+
|
|
22
|
+
// Global Variables
|
|
23
|
+
setOutput('is_prerelease', state.prerelease);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function shouldRunStart({ isMaster, isWorkflowDispatch, botRun }) {
|
|
27
|
+
return isMaster && isWorkflowDispatch && !botRun;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function shouldRunPromote({ isReleaseBranch, isWorkflowDispatch, botRun }) {
|
|
31
|
+
return isReleaseBranch && isWorkflowDispatch && !botRun;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function shouldRunChangesets({ isReleaseBranch, isPush, isWorkflowDispatch, botRun }) {
|
|
35
|
+
return (isReleaseBranch && isPush) || (isReleaseBranch && isWorkflowDispatch && botRun);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function shouldRunPublish({ isReleaseBranch, isPush, hasPendingChangesets, isPublishedOnNpm }) {
|
|
39
|
+
return isReleaseBranch && isPush && !hasPendingChangesets && !isPublishedOnNpm;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function shouldRunMerge({
|
|
43
|
+
isReleaseBranch,
|
|
44
|
+
isPush,
|
|
45
|
+
prerelease,
|
|
46
|
+
isCurrentFinalVersion,
|
|
47
|
+
hasPendingChangesets,
|
|
48
|
+
prBackExists,
|
|
49
|
+
}) {
|
|
50
|
+
return isReleaseBranch && isPush && !prerelease && isCurrentFinalVersion && !hasPendingChangesets && !prBackExists;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function getState({ github, context, core }) {
|
|
54
|
+
// Variables not in the context
|
|
55
|
+
const refName = process.env.GITHUB_REF_NAME;
|
|
56
|
+
const botRun = process.env.TRIGGERING_ACTOR === 'github-actions[bot]';
|
|
57
|
+
|
|
58
|
+
const { changesets, preState } = await readChangesetState();
|
|
59
|
+
|
|
60
|
+
// Static vars
|
|
61
|
+
const state = {
|
|
62
|
+
refName,
|
|
63
|
+
hasPendingChangesets: changesets.length > 0,
|
|
64
|
+
prerelease: preState?.mode === 'pre',
|
|
65
|
+
isMaster: refName === 'master',
|
|
66
|
+
isReleaseBranch: refName.startsWith('release-v'),
|
|
67
|
+
isWorkflowDispatch: context.eventName === 'workflow_dispatch',
|
|
68
|
+
isPush: context.eventName === 'push',
|
|
69
|
+
isCurrentFinalVersion: !version.includes('-rc.'),
|
|
70
|
+
botRun,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Async vars
|
|
74
|
+
const { data: prs } = await github.rest.pulls.list({
|
|
75
|
+
owner: context.repo.owner,
|
|
76
|
+
repo: context.repo.repo,
|
|
77
|
+
head: `${context.repo.owner}:merge/${state.refName}`,
|
|
78
|
+
base: 'master',
|
|
79
|
+
state: 'open',
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
state.prBackExists = prs.length !== 0;
|
|
83
|
+
|
|
84
|
+
state.isPublishedOnNpm = await isPublishedOnNpm(packageName, version);
|
|
85
|
+
|
|
86
|
+
// Log every state value in debug mode
|
|
87
|
+
if (core.isDebug()) for (const [key, value] of Object.entries(state)) core.debug(`${key}: ${value}`);
|
|
88
|
+
|
|
89
|
+
return state;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// From https://github.com/changesets/action/blob/v1.4.1/src/readChangesetState.ts
|
|
93
|
+
async function readChangesetState(cwd = process.cwd()) {
|
|
94
|
+
const preState = await readPreState(cwd);
|
|
95
|
+
const isInPreMode = preState !== undefined && preState.mode === 'pre';
|
|
96
|
+
|
|
97
|
+
let changesets = await readChangesets(cwd);
|
|
98
|
+
|
|
99
|
+
if (isInPreMode) {
|
|
100
|
+
changesets = changesets.filter(x => !preState.changesets.includes(x.id));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
preState: isInPreMode ? preState : undefined,
|
|
105
|
+
changesets,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async function isPublishedOnNpm(package, version) {
|
|
110
|
+
const res = await fetch(`https://registry.npmjs.com/${package}/${version}`);
|
|
111
|
+
return res.ok;
|
|
112
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// This script removes the build artifacts of ignored contracts.
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const match = require('micromatch');
|
|
8
|
+
|
|
9
|
+
function readJSON(path) {
|
|
10
|
+
return JSON.parse(fs.readFileSync(path));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pkgFiles = readJSON('package.json').files;
|
|
14
|
+
|
|
15
|
+
// Get only negated patterns.
|
|
16
|
+
const ignorePatterns = pkgFiles
|
|
17
|
+
.filter(pat => pat.startsWith('!'))
|
|
18
|
+
// Remove the negation part. Makes micromatch usage more intuitive.
|
|
19
|
+
.map(pat => pat.slice(1));
|
|
20
|
+
|
|
21
|
+
const ignorePatternsSubtrees = ignorePatterns
|
|
22
|
+
// Add **/* to ignore all files contained in the directories.
|
|
23
|
+
.concat(ignorePatterns.map(pat => path.join(pat, '**/*')))
|
|
24
|
+
.map(p => p.replace(/^\//, ''));
|
|
25
|
+
|
|
26
|
+
const artifactsDir = 'contracts/build/contracts';
|
|
27
|
+
const buildinfo = 'artifacts/build-info';
|
|
28
|
+
const filenames = fs.readdirSync(buildinfo);
|
|
29
|
+
|
|
30
|
+
let n = 0;
|
|
31
|
+
|
|
32
|
+
for (const filename of filenames) {
|
|
33
|
+
const solcOutput = readJSON(path.join(buildinfo, filename)).output;
|
|
34
|
+
for (const sourcePath in solcOutput.contracts) {
|
|
35
|
+
const ignore = match.any(sourcePath, ignorePatternsSubtrees);
|
|
36
|
+
if (ignore) {
|
|
37
|
+
for (const contract in solcOutput.contracts[sourcePath]) {
|
|
38
|
+
fs.unlinkSync(path.join(artifactsDir, contract + '.json'));
|
|
39
|
+
n += 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.error(`Removed ${n} mock artifacts`);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const minimatch = require('minimatch');
|
|
3
|
+
|
|
4
|
+
// Files matching these patterns will be ignored unless a rule has `static global = true`
|
|
5
|
+
const ignore = ['contracts/mocks/**/*', 'test/**/*'];
|
|
6
|
+
|
|
7
|
+
class Base {
|
|
8
|
+
constructor(reporter, config, source, fileName) {
|
|
9
|
+
this.reporter = reporter;
|
|
10
|
+
this.ignored = this.constructor.global || ignore.some(p => minimatch(path.normalize(fileName), p));
|
|
11
|
+
this.ruleId = this.constructor.ruleId;
|
|
12
|
+
if (this.ruleId === undefined) {
|
|
13
|
+
throw Error('missing ruleId static property');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
error(node, message) {
|
|
18
|
+
if (!this.ignored) {
|
|
19
|
+
this.reporter.error(node, this.ruleId, message);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = [
|
|
25
|
+
class extends Base {
|
|
26
|
+
static ruleId = 'interface-names';
|
|
27
|
+
|
|
28
|
+
ContractDefinition(node) {
|
|
29
|
+
if (node.kind === 'interface' && !/^I[A-Z]/.test(node.name)) {
|
|
30
|
+
this.error(node, 'Interface names should have a capital I prefix');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
class extends Base {
|
|
36
|
+
static ruleId = 'private-variables';
|
|
37
|
+
|
|
38
|
+
VariableDeclaration(node) {
|
|
39
|
+
const constantOrImmutable = node.isDeclaredConst || node.isImmutable;
|
|
40
|
+
if (node.isStateVar && !constantOrImmutable && node.visibility !== 'private') {
|
|
41
|
+
this.error(node, 'State variables must be private');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
class extends Base {
|
|
47
|
+
static ruleId = 'leading-underscore';
|
|
48
|
+
|
|
49
|
+
VariableDeclaration(node) {
|
|
50
|
+
if (node.isDeclaredConst) {
|
|
51
|
+
// TODO: expand visibility and fix
|
|
52
|
+
if (node.visibility === 'private' && /^_/.test(node.name)) {
|
|
53
|
+
this.error(node, 'Constant variables should not have leading underscore');
|
|
54
|
+
}
|
|
55
|
+
} else if (node.visibility === 'private' && !/^_/.test(node.name)) {
|
|
56
|
+
this.error(node, 'Non-constant private variables must have leading underscore');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
FunctionDefinition(node) {
|
|
61
|
+
if (node.visibility === 'private' || (node.visibility === 'internal' && node.parent.kind !== 'library')) {
|
|
62
|
+
if (!/^_/.test(node.name)) {
|
|
63
|
+
this.error(node, 'Private and internal functions must have leading underscore');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (node.visibility === 'internal' && node.parent.kind === 'library') {
|
|
67
|
+
if (/^_/.test(node.name)) {
|
|
68
|
+
this.error(node, 'Library internal functions should not have leading underscore');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// TODO: re-enable and fix
|
|
75
|
+
// class extends Base {
|
|
76
|
+
// static ruleId = 'no-external-virtual';
|
|
77
|
+
//
|
|
78
|
+
// FunctionDefinition(node) {
|
|
79
|
+
// if (node.visibility == 'external' && node.isVirtual) {
|
|
80
|
+
// this.error(node, 'Functions should not be external and virtual');
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
// },
|
|
84
|
+
];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const proc = require('child_process');
|
|
2
|
+
const read = cmd => proc.execSync(cmd, { encoding: 'utf8' }).trim();
|
|
3
|
+
const run = cmd => {
|
|
4
|
+
proc.execSync(cmd, { stdio: 'inherit' });
|
|
5
|
+
};
|
|
6
|
+
const tryRead = cmd => {
|
|
7
|
+
try {
|
|
8
|
+
return read(cmd);
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const releaseBranchRegex = /^release-v(?<version>(?<major>\d+)\.(?<minor>\d+)(?:\.(?<patch>\d+))?)$/;
|
|
15
|
+
|
|
16
|
+
const currentBranch = read('git rev-parse --abbrev-ref HEAD');
|
|
17
|
+
const match = currentBranch.match(releaseBranchRegex);
|
|
18
|
+
|
|
19
|
+
if (!match) {
|
|
20
|
+
console.error('Not currently on a release branch');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const pkgVersion = require('../package.json').version;
|
|
25
|
+
|
|
26
|
+
if (pkgVersion.includes('-') && !pkgVersion.includes('.0.0-')) {
|
|
27
|
+
console.error('Refusing to update docs: non-major prerelease detected');
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const current = match.groups;
|
|
32
|
+
const docsBranch = `docs-v${current.major}.x`;
|
|
33
|
+
|
|
34
|
+
// Fetch remotes and find the docs branch if it exists
|
|
35
|
+
run('git fetch --all --no-tags');
|
|
36
|
+
const matchingDocsBranches = tryRead(`git rev-parse --glob='*/${docsBranch}'`);
|
|
37
|
+
|
|
38
|
+
if (!matchingDocsBranches) {
|
|
39
|
+
// Create the branch
|
|
40
|
+
run(`git checkout --orphan ${docsBranch}`);
|
|
41
|
+
} else {
|
|
42
|
+
const [publishedRef, ...others] = new Set(matchingDocsBranches.split('\n'));
|
|
43
|
+
if (others.length > 0) {
|
|
44
|
+
console.error(
|
|
45
|
+
`Found conflicting ${docsBranch} branches.\n` +
|
|
46
|
+
'Either local branch is outdated or there are multiple matching remote branches.',
|
|
47
|
+
);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
const publishedVersion = JSON.parse(read(`git show ${publishedRef}:package.json`)).version;
|
|
51
|
+
const publishedMinor = publishedVersion.match(/\d+\.(?<minor>\d+)\.\d+/).groups.minor;
|
|
52
|
+
if (current.minor < publishedMinor) {
|
|
53
|
+
console.error('Refusing to update docs: newer version is published');
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
run('git checkout --quiet --detach');
|
|
58
|
+
run(`git reset --soft ${publishedRef}`);
|
|
59
|
+
run(`git checkout ${docsBranch}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
run('npm run prepare-docs');
|
|
63
|
+
run('git add -f docs'); // --force needed because generated docs files are gitignored
|
|
64
|
+
run('git commit -m "Update docs"');
|
|
65
|
+
run(`git checkout ${currentBranch}`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The upgradeable variant of OpenZeppelin Contracts is automatically generated from the original Solidity code. We call this process "transpilation" and it is implemented by our [Upgradeability Transpiler](https://github.com/OpenZeppelin/openzeppelin-transpiler/).
|
|
2
|
+
|
|
3
|
+
When the `master` branch or `release-v*` branches are updated, the code is transpiled and pushed to [OpenZeppelin/openzeppelin-contracts-upgradeable](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable) by the `upgradeable.yml` workflow.
|
|
4
|
+
|
|
5
|
+
## `transpile.sh`
|
|
6
|
+
|
|
7
|
+
Applies patches and invokes the transpiler with the command line flags we need for our requirements (for example, excluding certain files).
|
|
8
|
+
|
|
9
|
+
## `transpile-onto.sh`
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
bash scripts/upgradeable/transpile-onto.sh <target> [<base>]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Transpiles the contents of the current git branch and commits the result as a new commit on branch `<target>`. If branch `<target>` doesn't exist, it will copy the commit history of `[<base>]` (this is used in GitHub Actions, but is usually not necessary locally).
|
|
16
|
+
|
|
17
|
+
## `patch-apply.sh` & `patch-save.sh`
|
|
18
|
+
|
|
19
|
+
Some of the upgradeable contract variants require ad-hoc changes that are not implemented by the transpiler. These changes are implemented by patches stored in `upgradeable.patch` in this directory. `patch-apply.sh` applies these patches.
|
|
20
|
+
|
|
21
|
+
If the patches fail to apply due to changes in the repo, the conflicts have to be resolved manually. Once fixed, `patch-save.sh` will take the changes staged in Git and update `upgradeable.patch` to match.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")"
|
|
6
|
+
PATCH="$DIRNAME/upgradeable.patch"
|
|
7
|
+
|
|
8
|
+
error() {
|
|
9
|
+
echo Error: "$*" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if ! git diff-files --quiet ":!$PATCH" || ! git diff-index --quiet HEAD ":!$PATCH"; then
|
|
14
|
+
error "Repository must have no staged or unstaged changes"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if ! git apply -3 "$PATCH"; then
|
|
18
|
+
error "Fix conflicts and run $DIRNAME/patch-save.sh"
|
|
19
|
+
fi
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")"
|
|
6
|
+
PATCH="$DIRNAME/upgradeable.patch"
|
|
7
|
+
|
|
8
|
+
error() {
|
|
9
|
+
echo Error: "$*" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if ! git diff-files --quiet ":!$PATCH"; then
|
|
14
|
+
error "Unstaged changes. Stage to include in patch or temporarily stash."
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
git diff-index --cached --patch --output="$PATCH" HEAD
|
|
18
|
+
git restore --staged --worktree ":!$PATCH"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
if [ $# -lt 1 ]; then
|
|
6
|
+
echo "usage: bash $0 <target> [<base>]" >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
set -x
|
|
11
|
+
|
|
12
|
+
target="$1"
|
|
13
|
+
base="${2-}"
|
|
14
|
+
|
|
15
|
+
bash scripts/upgradeable/transpile.sh
|
|
16
|
+
|
|
17
|
+
commit="$(git rev-parse --short HEAD)"
|
|
18
|
+
start_branch="$(git rev-parse --abbrev-ref HEAD)"
|
|
19
|
+
|
|
20
|
+
git add contracts
|
|
21
|
+
|
|
22
|
+
# detach from the current branch to avoid making changes to it
|
|
23
|
+
git checkout --quiet --detach
|
|
24
|
+
|
|
25
|
+
# switch to the target branch, creating it if necessary
|
|
26
|
+
if git rev-parse -q --verify "$target"; then
|
|
27
|
+
# if the branch exists, make it the current HEAD without checking out its contents
|
|
28
|
+
git reset --soft "$target"
|
|
29
|
+
git checkout "$target"
|
|
30
|
+
else
|
|
31
|
+
# if the branch doesn't exist, create it as an orphan and check it out
|
|
32
|
+
git checkout --orphan "$target"
|
|
33
|
+
if [ -n "$base" ] && git rev-parse -q --verify "$base"; then
|
|
34
|
+
# if base was specified and it exists, set it as the branch history
|
|
35
|
+
git reset --soft "$base"
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# abort if there are no changes to commit at this point
|
|
40
|
+
if git diff --quiet --cached; then
|
|
41
|
+
exit
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
if [[ -v SUBMODULE_REMOTE ]]; then
|
|
45
|
+
lib=lib/openzeppelin-contracts
|
|
46
|
+
git submodule add -b "${base#origin/}" "$SUBMODULE_REMOTE" "$lib"
|
|
47
|
+
git -C "$lib" checkout "$commit"
|
|
48
|
+
git add "$lib"
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
git commit -m "Transpile $commit"
|
|
52
|
+
|
|
53
|
+
# return to original branch
|
|
54
|
+
git checkout "$start_branch"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail -x
|
|
4
|
+
|
|
5
|
+
VERSION="$(jq -r .version contracts/package.json)"
|
|
6
|
+
DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")"
|
|
7
|
+
|
|
8
|
+
bash "$DIRNAME/patch-apply.sh"
|
|
9
|
+
sed -i'' -e "s/<package-version>/$VERSION/g" "contracts/package.json"
|
|
10
|
+
git add contracts/package.json
|
|
11
|
+
|
|
12
|
+
npm run clean
|
|
13
|
+
npm run compile
|
|
14
|
+
|
|
15
|
+
build_info=($(jq -r '.input.sources | keys | if any(test("^contracts/mocks/.*\\bunreachable\\b")) then empty else input_filename end' artifacts/build-info/*))
|
|
16
|
+
build_info_num=${#build_info[@]}
|
|
17
|
+
|
|
18
|
+
if [ $build_info_num -ne 1 ]; then
|
|
19
|
+
echo "found $build_info_num relevant build info files but expected just 1"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# -D: delete original and excluded files
|
|
24
|
+
# -b: use this build info file
|
|
25
|
+
# -i: use included Initializable
|
|
26
|
+
# -x: exclude proxy-related contracts with a few exceptions
|
|
27
|
+
# -p: emit public initializer
|
|
28
|
+
# -n: use namespaces
|
|
29
|
+
# -N: exclude from namespaces transformation
|
|
30
|
+
# -q: partial transpilation using @openzeppelin/contracts as peer project
|
|
31
|
+
npx @openzeppelin/upgrade-safe-transpiler -D \
|
|
32
|
+
-b "$build_info" \
|
|
33
|
+
-i contracts/proxy/utils/Initializable.sol \
|
|
34
|
+
-x 'contracts-exposed/**/*' \
|
|
35
|
+
-x 'contracts/proxy/**/*' \
|
|
36
|
+
-x '!contracts/proxy/Clones.sol' \
|
|
37
|
+
-x '!contracts/proxy/ERC1967/ERC1967Storage.sol' \
|
|
38
|
+
-x '!contracts/proxy/ERC1967/ERC1967Utils.sol' \
|
|
39
|
+
-x '!contracts/proxy/utils/UUPSUpgradeable.sol' \
|
|
40
|
+
-x '!contracts/proxy/beacon/IBeacon.sol' \
|
|
41
|
+
-p 'contracts/**/presets/**/*' \
|
|
42
|
+
-n \
|
|
43
|
+
-N 'contracts/mocks/**/*' \
|
|
44
|
+
-q '@openzeppelin/'
|
|
45
|
+
|
|
46
|
+
# delete compilation artifacts of vanilla code
|
|
47
|
+
npm run clean
|