Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/contracts/ccip/ccipsend_executor/errors.tolk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enum CCIPSendExecutor_Error {
StateNotExpected = 43600; // Facility ID * 100
Unauthorized;
StateNotExpected = 43600 // Facility ID * 100
Unauthorized
}
2 changes: 1 addition & 1 deletion contracts/contracts/ccip/common/errors.tolk
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

enum Common_Error {
//Out of range?
CrossChainAddressOutOfRange = 5;
CrossChainAddressOutOfRange = 5
}
1 change: 0 additions & 1 deletion contracts/contracts/ccip/offramp/contract.tolk
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ fun _execute(msg: OffRamp_Execute, sender: address) {
msg.report.toCell(),
createEmptyCell(),
);

}

//todo: maybe it should be chainConfigs and take an array?
Expand Down
3 changes: 2 additions & 1 deletion contracts/contracts/ccip/onramp/contract.tolk
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ fun send(payload: OnRamp_Send, sender: address, jettonWallet: address? = null) {

val msg = payload.msg.load();

// validate allowlist
// Ensure the destination chain exists
val destChainConfig = st.destChainConfigs.mustGet(msg.destChainSelector, Error.UnknownDestChainSelector as int);

// ccipSend must be forwarded from the router
assert(destChainConfig.router == sender, Error.Unauthorized);

// validate allowlist
if (destChainConfig.allowlistEnabled) {
val entry = destChainConfig.allowedSenders.get(payload.metadata.sender);
assert(entry.isFound && entry.loadValue(), Error.SenderNotAllowed);
Expand Down
8 changes: 3 additions & 5 deletions contracts/contracts/ccip/onramp/errors.tolk
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import "../../lib/utils"

enum Error {
UnknownDestChainSelector = 18100; // Facility ID * 100
Unauthorized;
SenderNotAllowed;
UnknownDestChainSelector = 18100 // Facility ID * 100
Unauthorized
SenderNotAllowed
}


Expand Down
8 changes: 4 additions & 4 deletions contracts/contracts/ccip/receive_executor/errors.tolk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enum Error {
StateIsNotUntouched = 33800; // Facility ID * 100
UpdatingStateOfNonExecutedMessage;
NotificationFromInvalidReceiver;
Unauthorized; //TODO maybe use Ownable2Step or similar
StateIsNotUntouched = 33800 // Facility ID * 100
UpdatingStateOfNonExecutedMessage
NotificationFromInvalidReceiver
Unauthorized //TODO maybe use Ownable2Step or similar
}
10 changes: 5 additions & 5 deletions contracts/contracts/ccip/receive_executor/types.tolk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// State stores the general state machine indicating which phase we're in
// TODO: we might be able to merge this into execution_states
enum ReceiveExecutor_MessageState {
Untouched = 0;
TokenTransfer;
Execute ;
ExecuteFailed;
Success;
Untouched = 0
TokenTransfer
Execute
ExecuteFailed
Success
}
3 changes: 1 addition & 2 deletions contracts/contracts/ccip/router/contract.tolk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import "storage"
import "errors"
import "../onramp/messages"
import "../onramp/types"
import "../common/types"
import "../common/messages"
import "../../lib/access/ownable_2step"
import "../../lib/funding/withdrawable.tolk"
Expand Down Expand Up @@ -39,7 +38,7 @@ fun onInternalMessage(in: InMessage) {
}
}

fun onBouncedMessage(in: InMessageBounced) {
fun onBouncedMessage(_: InMessageBounced) {
}

fun onSetRamps(msg: Router_SetRamps, sender: address) {
Expand Down
4 changes: 1 addition & 3 deletions contracts/contracts/ccip/router/errors.tolk
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import "../../lib/utils"

enum Error {
DestChainNotEnabled = 49600; // Facility ID * 100
DestChainNotEnabled = 49600 // Facility ID * 100
}

4 changes: 1 addition & 3 deletions contracts/contracts/ccip/test/receiver/errors.tolk
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import "../../../lib/utils"

enum Error {
Unauthorized = 34600; // Facility ID * 100
Unauthorized = 34600 // Facility ID * 100
}

Loading