Skip to content

Commit

Permalink
Merge pull request #923 from molecula451/update-chore
Browse files Browse the repository at this point in the history
chore: some updates, cast to uint256
  • Loading branch information
rndquu authored Apr 17, 2024
2 parents a1b11e1 + 7faf8e5 commit 3afad00
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 8,329 deletions.
8,275 changes: 0 additions & 8,275 deletions packages/contracts/deployments.json

This file was deleted.

12 changes: 12 additions & 0 deletions packages/contracts/run-smt-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Define paths
foundryTomlPath="foundry.toml"
backupFoundryTomlPath="foundry.toml.backup"
smtScriptPath="scripts/smt-checker/smt/smt.ts"

# Copy foundry.toml to backup file
cp -p "$foundryTomlPath" "$backupFoundryTomlPath"

# Run smt.ts script
npx tsx "$smtScriptPath"
1 change: 0 additions & 1 deletion packages/contracts/scripts/shared/constants/networks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const Networks: Record<string, number> = {
mainnet: 1,
optimism: 10,
goerli: 5,
sepolia: 11155111,
};

Expand Down
26 changes: 21 additions & 5 deletions packages/contracts/scripts/smt-checker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Ensure that your system has Z3 installed with a version number greater than or e
Before proceeding, ensure that you have `g++` and `python3` installed on your system. To download and install Z3, enter the following commands in your terminal:

### Run script:
```
sh ./update-dependencies.sh
```sh
./update-deps-ubuntu
```

Once installed, you can verify that Z3 is correctly installed by checking the version number.
Expand All @@ -40,8 +40,8 @@ https://github.com/molecula451/ubiquity-dollar/assets/41552663/cdcf3982-94a4-4cf

Ensure that your repository is up-to-date with the latest npm/yarn packages, then run the following command:

```
sh ./run-smt-setup.sh
```sh
./run-smt-setup
```


Expand All @@ -51,4 +51,20 @@ https://github.com/molecula451/ubiquity-dollar/assets/41552663/a4cad18e-0686-463

This will prompt you to select a contract. Once selected, check that the contract was updated in Foundry, then build it using forge build. Wait for the SMT-Checker results to appear after compiling.

![checker](https://github.com/molecula451/ubiquity-dollar/assets/41552663/a8e6a3de-2ccf-40bd-8d19-c1b4203c466f)
![checker](https://github.com/molecula451/ubiquity-dollar/assets/41552663/a8e6a3de-2ccf-40bd-8d19-c1b4203c466f)

## Debug

On Ubuntu you might get:

```sh
Compiler run failed:
Error: Unknown exception during compilation: Dynamic exception type: std::runtime_error
std::exception::what: locale::facet::_S_create_c_locale name not valid

```
#### Fix

```sh
export LC_ALL=C; unset LANGUAGE
```
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ library LibDirectGovernanceFarmer {
* @notice Deposits a single token to staking
* @notice Stable coin (DAI / USDC / USDT / Ubiquity Dollar) => Dollar-3CRV LP => Ubiquity Staking
* @notice How it works:
* 1. User deposit stablecoins (DAI / USDC / USDT / Dollar)
* 2. Deposited stablecoins are added to Dollar-3CRV Curve MetaPool
* 1. User deposit supported stablecoins
* 2. Deposited stablecoins are added to Curve MetaPool
* 3. User gets Dollar-3CRV LP tokens
* 4. Dollar-3CRV LP tokens are transferred to the staking contract
* 5. User gets a staking share id
* @param token Token deposited : DAI, USDC, USDT or Ubiquity Dollar
* @param token Token deposited : Stablecoin
* @param amount Amount of tokens to deposit (For max: `uint256(-1)`)
* @param durationWeeks Duration in weeks tokens will be locked (1-208)
* @return stakingShareId Staking share id
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/dollar/core/StakingShare.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ contract StakingShareTest is DepositStakingShare {
}

function testUUPS_InitializedVersion() external {
uint expectedVersion = 1;
uint baseExpectedVersion = 255;
uint256 expectedVersion = 1;
uint256 baseExpectedVersion = 255;

BondingShare bondingShare = new BondingShare();
BondingShareUpgraded bondingShareUpgraded = new BondingShareUpgraded();
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/dollar/core/UbiquityCreditToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ contract UbiquityCreditTokenTest is LocalTestHelper {
}

function testUUPS_InitializedVersion() external {
uint expectedVersion = 1;
uint baseExpectedVersion = 255;
uint256 expectedVersion = 1;
uint256 baseExpectedVersion = 255;

UbiquityCreditTokenUpgraded newImpl = new UbiquityCreditTokenUpgraded();
UbiquityCreditTokenUpgraded newImplT = new UbiquityCreditTokenUpgraded();
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/test/dollar/core/UbiquityDollarToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ contract UbiquityDollarTokenTest is LocalTestHelper {
}

function testUUPS_InitializedVersion() external {
uint expectedVersion = 1;
uint baseExpectedVersion = 255;
uint256 expectedVersion = 1;
uint256 baseExpectedVersion = 255;

UbiquityDollarTokenUpgraded newImpl = new UbiquityDollarTokenUpgraded();
UbiquityDollarTokenUpgraded newImplT = new UbiquityDollarTokenUpgraded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ contract UbiquityGovernanceTokenTest is LocalTestHelper {
}

function testUUPS_InitializedVersion() external {
uint expectedVersion = 1;
uint baseExpectedVersion = 255;
uint256 expectedVersion = 1;
uint256 baseExpectedVersion = 255;

UbiquityGovernanceTokenUpgraded newImpl = new UbiquityGovernanceTokenUpgraded();
UbiquityGovernanceTokenUpgraded newImplT = new UbiquityGovernanceTokenUpgraded();
Expand Down
26 changes: 0 additions & 26 deletions packages/dapp/components/lib/hooks/use-deployed-address.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions packages/dapp/components/utils/deployments.ts

This file was deleted.

0 comments on commit 3afad00

Please sign in to comment.