Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Apr 30, 2024
1 parent 71ba229 commit 70bee4f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
25 changes: 20 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,38 @@ Please follow <https://changelog.md/> conventions.



## 1.0.1 - 20240429
## 1.0.1 - 20240430

In the version 1.0.0, when fees are paid in native tokens, the function ccipSend from the CCIP router was called without the `value`argument.
- In the version 1.0.0, when fees are paid in native tokens, the function `ccipSend` from the CCIP router was called without the `value`argument.

Old version
**Old version**

```solidity
// Send CCIP Message
messageId = router.ccipSend(_destinationChainSelector, message);
```

**new version**

```solidity
if(_paymentMethodId == 0){ // Native token
messageId = router.ccipSend{value: fees}(_destinationChainSelector, message);
messageId = router.ccipSend{value: fees}(_destinationChainSelector, message);
} else{
messageId = router.ccipSend(_destinationChainSelector, message);
messageId = router.ccipSend(_destinationChainSelector, message);
}
```

Tests have been improved to catch this bug.

- Chainlink has released a library ([Chainlink local](https://github.com/smartcontractkit/chainlink-local/tree/main)) to test Chainlink CCIP locally. This version includes a test using this simulator where fees are paid in native tokens.

- This version adds also:

- A public function ` getFee` in order to know the fees from the router
- A function `setMessageData`to set the data inside the message if in the future, there is a change in the CCIP bridge. Current default value is an empty string
- Rename the function `setGasLimit` in `setMessageGasLimit` to clearly indicate that it is the gas limit put in the message for CCIP.



## 1.0.0 - 20240423

Expand Down
2 changes: 1 addition & 1 deletion doc/technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setAllowlistChain(6433500567565415381, true, true)

### Authorize user to use the contracts

Our function `transferTokens` from our sender contract is protected by an access control. Only authorized user can transfer tokens. Therefore we will authorize our
Our function `transferTokens` from our sender contract is protected by an access control. Only authorized user can transfer tokens. Therefore we have to authorize each users by granting them the role `BRIDGE_USER_ROLE'

```solidity
grantRole(bytes32 role, address account)
Expand Down
6 changes: 0 additions & 6 deletions src/bridge/modules/security/AuthorizationModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import "openzeppelin-contracts/access/AccessControl.sol";


abstract contract AuthorizationModule is AccessControl{
/**
* @notice Manage the failed message and transfer tokens if necessary.
* @dev used by CCCIP Receiver Defensive
*/
bytes32 public constant BRIDGE_MESSAGE_MANAGER = keccak256("BRIDGE_MESSAGE_MANAGER");

/**
* @notice Can manage the different chain allowed by our bridge
*/
Expand Down
7 changes: 0 additions & 7 deletions test/nativeToken/baseNativeToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ contract baseTest is HelperContract {
);
erc20 = new ERC20Mock();
}


/*********** CCIPSender Payment ***********/

function testCanAdminSetTokenNativeAsFee() public{
Expand Down Expand Up @@ -76,12 +74,7 @@ contract baseTest is HelperContract {
CCIPSENDER_CONTRACT.withdrawNativeTokens(RECEIVER_ADDRESS, 0 ether);
}




/****Build token amounts */


function testCanBuildCCIPTransferMessageForOneTokenWithNativeTokens() public{
// Arrange
uint256 value = 1000;
Expand Down

0 comments on commit 70bee4f

Please sign in to comment.