/** * Access control rules for mynetwork / rule Default { description: "Allow all participants access to all resources" participant: "ANY" operation: ALL resource: "org.acme.mynetwork." action: ALLOW } rule SystemACL { description: "System ACL to permit all access" participant: "org.hyperledger.composer.system.Participant" operation: ALL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.16; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol"; | |
import "@chainlink/contracts/src/v0.8/Denominations.sol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
interface IERC20 { | |
function totalSupply() external view returns (uint256); | |
function balanceOf(address who) external view returns (uint256); | |
function allowance(address owner, address spender) external view returns (uint256); | |
function transfer(address to, uint256 value) external returns (bool); | |
function approve(address spender, uint256 value) external returns (bool); | |
function transferFrom(address from, address to, uint256 value) external returns (bool); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Slither BaseJumpRateModelV2.sol | |
INFO:Detectors: | |
BaseJumpRateModelV2.getSupplyRate(uint256,uint256,uint256,uint256) (BaseJumpRateModelV2.sol#115-120) performs a multiplication on the result of a division: | |
-rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18) (BaseJumpRateModelV2.sol#118) | |
-utilizationRate(cash,borrows,reserves).mul(rateToPool).div(1e18) (BaseJumpRateModelV2.sol#119) | |
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#divide-before-multiply | |
INFO:Detectors: | |
Constant BaseJumpRateModelV2.blocksPerYear (BaseJumpRateModelV2.sol#23) is not in UPPER_CASE_WITH_UNDERSCORES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Slither BaseJumpRateModelV2.sol | |
INFO:Detectors: | |
BaseJumpRateModelV2.getSupplyRate(uint256,uint256,uint256,uint256) (BaseJumpRateModelV2.sol#115-120) performs a multiplication on the result of a division: | |
-rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18) (BaseJumpRateModelV2.sol#118) | |
-utilizationRate(cash,borrows,reserves).mul(rateToPool).div(1e18) (BaseJumpRateModelV2.sol#119) | |
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#divide-before-multiply | |
INFO:Detectors: | |
Constant BaseJumpRateModelV2.blocksPerYear (BaseJumpRateModelV2.sol#23) is not in UPPER_CASE_WITH_UNDERSCORES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO:Detectors: | |
EIP20NonStandardInterface (EIP20NonStandardInterface.sol#8-70) has incorrect ERC20 function interface:EIP20NonStandardInterface.transfer(address,uint256) (EIP20NonStandardInterface.sol#34) | |
EIP20NonStandardInterface (EIP20NonStandardInterface.sol#8-70) has incorrect ERC20 function interface:EIP20NonStandardInterface.transferFrom(address,address,uint256) (EIP20NonStandardInterface.sol#48) | |
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-erc20-interface | |
INFO:Detectors: | |
CToken.accrueInterest() (CToken.sol#384-462) uses a dangerous strict equality: | |
- accrualBlockNumberPrior == currentBlockNumber (CToken.sol#390) | |
CToken.accrueInterest() (CToken.sol#384-462) uses a dangerous strict equality: | |
- require(bool,string)(mathErr == MathError.NO_ERROR,could not calculate block delta) (CToken.sol#406) | |
CToken.balanceOfUnderlying(address) (CToken.sol#190-195) uses a dangerous strict equality: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.21 <0.6.0; | |
//Add ProductManagement ABI to allow calls | |
contract ProductManagement{ | |
struct Part{ | |
address manufacturer; | |
string serial_number; | |
string part_type; | |
string creation_date; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.0 <0.6.0; | |
// This line says the code will compile with version greater than 0.4 and less than 0.6 | |
contract Voting { | |
// constructor to initialize candidates | |
// vote for candidates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that revert on error | |
*/ | |
library SafeMath { | |
/** | |
* @dev Multiplies two numbers, reverts on overflow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step One: Create a Business Network Definition | |
We will begin by cloning a sample business network. Open up a command prompt and execute the | |
following command: | |
▪ | |
git clone https://github.com/hyperledger/composer-sample-networks.git | |
Make a copy of this directory in your project, called 'my-network’ by using the following command: | |
▪ | |
cp -r ./composer-sample-networks/packages/basic-sample-network/ ./my-network | |
Open Visual Studio(VS) Code and click on Open Folder. |
NewerOlder