Open piwonskp opened 1 year ago
In solidity you can use unsafe operators by putting them in an unchecked block:
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; contract UncheckedMath { function add(uint x, uint y) external pure returns (uint) { // 22291 gas // return x + y; // 22103 gas unchecked { return x + y; } } }
Cairo 1 got functions implementing unsafe operations in https://github.com/starkware-libs/cairo/blob/9c3cb9633a9ef8595b3ee041a00b37b84d964af7/corelib/src/integer.cairo#L30.
In solidity you can use unsafe operators by putting them in an unchecked block:
Cairo 1 got functions implementing unsafe operations in https://github.com/starkware-libs/cairo/blob/9c3cb9633a9ef8595b3ee041a00b37b84d964af7/corelib/src/integer.cairo#L30.