Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use calldata instead of memory #236

Merged
merged 1 commit into from
Nov 10, 2023
Merged
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/modules/internal/ERC20SnapshotModuleInternal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ abstract contract ERC20SnapshotModuleInternal is ERC20Upgradeable {
* @dev Initializes the contract
*/
function __ERC20Snapshot_init(
string calldata name_,
string calldata symbol_
string memory name_,
string memory symbol_
) internal onlyInitializing {
__Context_init_unchained();
__ERC20_init(name_, symbol_);
Expand Down
6 changes: 3 additions & 3 deletions contracts/modules/wrapper/core/BaseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract contract BaseModule is AuthorizationModule {
@notice the tokenId will be changed even if the new value is the same as the current one
*/
function setTokenId(
string memory tokenId_
string calldata tokenId_
) public onlyRole(DEFAULT_ADMIN_ROLE) {
tokenId = tokenId_;
emit TokenId(tokenId_, tokenId_);
Expand All @@ -85,7 +85,7 @@ abstract contract BaseModule is AuthorizationModule {
@notice The terms will be changed even if the new value is the same as the current one
*/
function setTerms(
string memory terms_
string calldata terms_
) public onlyRole(DEFAULT_ADMIN_ROLE) {
terms = terms_;
emit Term(terms_, terms_);
Expand All @@ -95,7 +95,7 @@ abstract contract BaseModule is AuthorizationModule {
@notice The information will be changed even if the new value is the same as the current one
*/
function setInformation(
string memory information_
string calldata information_
) public onlyRole(DEFAULT_ADMIN_ROLE) {
information = information_;
emit Information(information_, information_);
Expand Down
4 changes: 2 additions & 2 deletions contracts/modules/wrapper/core/ERC20BurnModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract contract ERC20BurnModule is ERC20Upgradeable, AuthorizationModule {
function forceBurn(
address account,
uint256 value,
string memory reason
string calldata reason
) public onlyRole(BURNER_ROLE) {
_burn(account, value);
emit Burn(account, value, reason);
Expand All @@ -73,7 +73,7 @@ abstract contract ERC20BurnModule is ERC20Upgradeable, AuthorizationModule {
function forceBurnBatch(
address[] calldata accounts,
uint256[] calldata values,
string memory reason
string calldata reason
) public onlyRole(BURNER_ROLE) {
if (accounts.length == 0) {
revert Errors.CMTAT_BurnModule_EmptyAccounts();
Expand Down
20 changes: 2 additions & 18 deletions contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,8 @@ abstract contract DebtBaseModule is
@notice Set all attributes of debt
The values of all attributes will be changed even if the new values are the same as the current ones
*/
function setDebt(DebtBase memory debt_) public onlyRole(DEBT_ROLE) {
// setGuarantor
debt = (
DebtBase(
debt_.interestRate,
debt_.parValue,
debt_.guarantor,
debt_.bondHolder,
debt_.maturityDate,
debt_.interestScheduleFormat,
debt_.interestPaymentDate,
debt_.dayCountConvention,
debt_.businessDayConvention,
debt_.publicHolidaysCalendar,
debt_.issuanceDate,
debt_.couponFrequency
)
);
function setDebt(DebtBase calldata debt_) public onlyRole(DEBT_ROLE) {
debt = debt_;
emit InterestRate(debt_.interestRate);
emit ParValue(debt_.parValue);
emit Guarantor(debt_.guarantor, debt_.guarantor);
Expand Down