paxosglobal / busd-contract

Solidity smart contracts for the BUSD stablecoin
MIT License
141 stars 89 forks source link

Update truffle and other dependencies #42

Closed henryksarat closed 1 year ago

henryksarat commented 1 year ago

Changelog

make all output:

yarn install
yarn install v1.22.5
warning ../../../../../package.json: No license field
[1/4] πŸ”  Resolving packages...
success Already up-to-date.
✨  Done in 0.28s.

> busd@0.0.1 solium
> solium -d contracts/ --fix

No issues found.

> busd@0.0.1 compile
> truffle compile

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

> busd@0.0.1 truffle-abi
> cat build/contracts/BUSDImplementation.json | jq -c .abi > BUSD.abi

> busd@0.0.1 truffle-bin
> cat build/contracts/BUSDImplementation.json | jq  -r .bytecode > BUSD.bin

> busd@0.0.1 flatten-impl
> truffle-flattener ./contracts/BUSDImplementation.sol > ./flattened/BUSDImplementation.sol

(node:3188) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3188) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency

> busd@0.0.1 flatten-proxy
> truffle-flattener ./contracts/zeppelin/AdminUpgradeabilityProxy.sol > ./flattened/AdminUpgradeabilityProxy.sol

(node:3387) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3387) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency

> busd@0.0.1 coverage
> truffle run coverage --network coverage

> Using Truffle library from local node_modules.

> server:            http://127.0.0.1:8555
> truffle:           v5.4.29
> ganache-core:      v2.13.0
> solidity-coverage: v0.7.14

Network Info
============
> id:      *
> port:    8555
> network: coverage

Instrumenting for coverage...
=============================

> BUSDImplementation.sol
> zeppelin/AddressUtils.sol
> zeppelin/AdminUpgradeabilityProxy.sol
> zeppelin/Proxy.sol
> zeppelin/SafeMath.sol
> zeppelin/UpgradeabilityProxy.sol

Coverage skipped for:
=====================

> Migrations.sol
> mocks/BUSDWithBalance.sol
> mocks/SafeMathMock.sol

Compiling your contracts...
===========================
> Compiling ./.coverage_contracts/BUSDImplementation.sol
> Compiling ./.coverage_contracts/Migrations.sol
> Compiling ./.coverage_contracts/mocks/BUSDWithBalance.sol
> Compiling ./.coverage_contracts/mocks/SafeMathMock.sol
> Compiling ./.coverage_contracts/zeppelin/AddressUtils.sol
> Compiling ./.coverage_contracts/zeppelin/AdminUpgradeabilityProxy.sol
> Compiling ./.coverage_contracts/zeppelin/Proxy.sol
> Compiling ./.coverage_contracts/zeppelin/SafeMath.sol
> Compiling ./.coverage_contracts/zeppelin/UpgradeabilityProxy.sol
> Compilation warnings encountered:

    project:/.coverage_contracts/zeppelin/SafeMath.sol:9:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0xd904add3(bytes32 c__0xd904add3) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/BUSDImplementation.sol:21:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0xfc75fc1c(bytes32 c__0xfc75fc1c) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/zeppelin/AddressUtils.sol:8:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0x93dfc96a(bytes32 c__0x93dfc96a) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/zeppelin/Proxy.sol:11:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0x8aa665da(bytes32 c__0x8aa665da) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/zeppelin/UpgradeabilityProxy.sol:13:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0xc8262f2c(bytes32 c__0xc8262f2c) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/zeppelin/AdminUpgradeabilityProxy.sol:14:23: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function c_0xd5391848(bytes32 c__0xd5391848) public pure {}
                      ^-------------------^
,project:/.coverage_contracts/zeppelin/AdminUpgradeabilityProxy.sol:70:36: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 ... ifAdmin ...
     ^-----^
,project:/.coverage_contracts/zeppelin/AdminUpgradeabilityProxy.sol:80:45: Warning: Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 ... ifAdmin ...
     ^-----^
,project:/.coverage_contracts/zeppelin/Proxy.sol:63:5: Warning: Function state mutability can be restricted to pure
    function _willFallback() internal {c_0x8aa665da(0x25c3eec453ced9a693130c576b94cc08e47f42a03806cc3e85e6c2564de9b62a); /* function */
    ^ (Relevant source part starts here and spans across multiple lines).

> Artifacts written to /Users/henryksarat/go/src/github.com/paxosglobal/busd-contract/.coverage_artifacts/contracts
> Compiled successfully using:
   - solc: 0.4.24+commit.e67f0147.Emscripten.clang

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

  Contract: BUSD
    when the asset protection role is unset
      βœ“ reverts asset protection actions (332ms)
    as a asset-protection token
      after setting the AssetProtectionRole
        βœ“ the current asset Protection role is set
      freeze
        βœ“ reverts when sender is not asset protection
        βœ“ adds the frozen address (45ms)
        βœ“ emits an AddressFrozen event
        βœ“ reverts when address is already frozen (64ms)
        when frozen
          βœ“ reverts when transfer is from frozen address
          βœ“ reverts when transfer is to frozen address
          βœ“ reverts when transferFrom is by frozen address (70ms)
          βœ“ reverts when transferFrom is from frozen address
          βœ“ reverts when transferFrom is to frozen address
          βœ“ reverts when approve is from the frozen address
          βœ“ reverts when approve spender is the frozen address
      unfreeze
        βœ“ reverts when address is already unfrozen
        when already frozen
          βœ“ reverts when sender is not asset protection
          βœ“ removes a frozen address
          βœ“ unfrozen address can transfer again (124ms)
          βœ“ emits an AddressFrozen event
      wipeFrozenAddress
        βœ“ reverts when address is not frozen
        when already frozen with assets and approvals
          βœ“ reverts when sender is not asset protection
          βœ“ wipes a frozen address balance (42ms)
          βœ“ emits an FrozenAddressWiped event
      setAssetProtectionRole
        βœ“ reverts if sender is not owner or AssetProtectionRole
        βœ“ works if sender is AssetProtectionRole
        βœ“ enables new AssetProtectionRole to freeze (69ms)
        βœ“ prevents old AssetProtectionRole from freezing (50ms)
        βœ“ emits a AssetProtectionRoleSet event

  Contract: CanReclaimFunds
    βœ“ should not accept Eth
    βœ“ should allow owner to reclaim tokens (46ms)
    βœ“ should allow only owner to reclaim tokens

  Contract: BetaDelegatedTransfer BUSD
    as a token with delegated transfer
      βœ“ can do a delegated transfer (179ms)
      βœ“ fails for bad signatures
      βœ“ fails for bad seq (48ms)
      βœ“ fails for insufficient balance (45ms)
      βœ“ fails for expired blockNumber
      βœ“ does not allow zero value with zero fee
      βœ“ fails for a non-whitelisted address
      βœ“ Handles zero fee without a fee transfer event (66ms)
      with multiple delegated transfers
        βœ“ can do two delegated transfers (250ms)
        βœ“ can do two delegated transfers in a batch (95ms)
        βœ“ reverts batches to act atomically (105ms)
    as a token with a delegate whitelister
      βœ“ can whitelist an delegate/executor (73ms)
      βœ“ can unwhitelist (77ms)
      βœ“ whitelister can set new whitelister
      βœ“ non-whitelister who is not owner cannot set new whitelister or whitelist/unwhitelist (122ms)
      βœ“ cannot set whitelister to address zero

  Contract: ERC20Basic BUSD
    basic data
      βœ“ has getters for the name, symbol, and decimals
    total supply
      βœ“ returns the total amount of tokens
    balanceOf
      when the requested account has no tokens
        βœ“ returns zero
      when the requested account has some tokens
        βœ“ returns the total amount of tokens
    transfer
      when the recipient is not the zero address
        when the sender does not have enough balance
          βœ“ reverts
        when the sender has enough balance
          βœ“ transfers the requested amount (44ms)
          βœ“ emits a transfer event
      when the recipient is the zero address
        βœ“ reverts

  Contract: ERC20 BUSD
    approve
      when the spender is not the zero address
        when the sender has enough balance
          βœ“ emits an approval event
          when there was no approved amount before
            βœ“ approves the requested amount
          when the spender had an approved amount
            βœ“ approves the requested amount and replaces the previous one
        when the sender does not have enough balance
          βœ“ emits an approval event
          when there was no approved amount before
            βœ“ approves the requested amount (39ms)
          when the spender had an approved amount
            βœ“ approves the requested amount and replaces the previous one
      when the spender is the zero address
        βœ“ approves the requested amount
        βœ“ emits an approval event
    transfer from
      when the recipient is not the zero address
        when the spender has enough approved balance
          when the owner has enough balance
            βœ“ transfers the requested amount (49ms)
            βœ“ decreases the spender allowance (38ms)
            βœ“ emits a transfer event
          when the owner does not have enough balance
            βœ“ reverts
        when the spender does not have enough approved balance
          when the owner has enough balance
            βœ“ reverts
          when the owner does not have enough balance
            βœ“ reverts
      when the recipient is the zero address
        βœ“ reverts

  Contract: Ownable BUSD
    as an ownable
      βœ“ should have an owner
      βœ“ sets new potential owner after proposeOwner (43ms)
      βœ“ allows owner to removes proposed owner after disregardProposeOwner (65ms)
      βœ“ allows proposed to removes proposed owner after disregardProposeOwner (68ms)
      βœ“ should prevent current owner from proposing itself as new owner (58ms)
      βœ“ should prevent non-proposed owners from calling disregardProposeOwner (62ms)
      βœ“ should prevent calling disregardProposeOwner if there is no proposed owner to disregard
      βœ“ sets new owner after completeTransferOwnership (65ms)
      βœ“ should prevent non-owners from transferring ownership
      βœ“ should prevent non-proposedOwners from finishing transferring ownership (68ms)
      βœ“ should guard ownership against stuck state
    as an initializable token
      βœ“ you should not be able to initialize a second time
      βœ“ constructor initializes the implementation contract and pauses it to avoid misleading state there (38ms)

  Contract: SafeMath
    add
      βœ“ adds correctly
      βœ“ reverts on addition overflow
    sub
      βœ“ subtracts correctly
      βœ“ reverts if subtraction result would be negative

  Contract: Pausable BUSD
    βœ“ can transfer in non-pause (47ms)
    βœ“ cannot transfer in pause (97ms)
    βœ“ cannot approve/transferFrom in pause (112ms)
    βœ“ should resume allowing normal process after pause is over (92ms)
    βœ“ cannot unpause when unpaused or pause when paused (81ms)

  Contract: BUSD
    as a supply-controlled token
      after token creation
        βœ“ sender should be token owner
        βœ“ sender should be supply controller
        βœ“ total supply should be zero
        βœ“ balances should be zero
      increaseSupply
        βœ“ reverts when sender is not supply controller
        βœ“ adds the requested amount (45ms)
        βœ“ emits a SupplyIncreased and a Transfer event
        βœ“ cannot increaseSupply resulting in positive overflow of the totalSupply (139ms)
      decreaseSupply
        when the supply controller has insufficient tokens
          βœ“ reverts
        when the supply controller has sufficient tokens
          βœ“ reverts when sender is not supply controller
          βœ“ removes the requested amount (44ms)
          βœ“ emits a SupplyDecreased and a Transfer event
      setSupplyController
        βœ“ reverts if sender is not owner or supplyController
        βœ“ works if sender is supply controller
        βœ“ reverts if newSupplyController is address zero
        βœ“ enables new supply controller to increase and decrease supply (119ms)
        βœ“ prevents old supply controller from increasing and decreasing supply (52ms)
        βœ“ emits a SupplyControllerSet event

  109 passing (30s)

-------------------------------|----------|----------|----------|----------|----------------|
File                           |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-------------------------------|----------|----------|----------|----------|----------------|
 contracts/                    |      100 |    90.43 |      100 |      100 |                |
  BUSDImplementation.sol       |      100 |    90.43 |      100 |      100 |                |
 contracts/zeppelin/           |    76.47 |    57.14 |    76.19 |    80.49 |                |
  AddressUtils.sol             |      100 |      100 |      100 |      100 |                |
  AdminUpgradeabilityProxy.sol |     62.5 |     37.5 |       60 |    68.42 |... 63,83,97,98 |
  Proxy.sol                    |      100 |      100 |      100 |      100 |                |
  SafeMath.sol                 |      100 |      100 |      100 |      100 |                |
  UpgradeabilityProxy.sol      |    71.43 |       50 |       75 |    77.78 |          52,53 |
-------------------------------|----------|----------|----------|----------|----------------|
All files                      |    95.38 |    86.11 |    91.23 |     95.7 |                |
-------------------------------|----------|----------|----------|----------|----------------|

> Istanbul reports written to ./coverage/ and ./coverage.json
> solidity-coverage cleaning up, shutting down ganache server