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
Changelog
make test-contracts
andmake test-contracts-coverage
commands without errors.make all
output: