Skip to content

Commit

Permalink
Use old name
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Nov 27, 2023
1 parent 075c9da commit b012b70
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 99 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- examples/voting/Cargo.toml
- examples/eSealing/Cargo.toml
- examples/auction/Cargo.toml
- examples/cis2-multi-sponsored-txs/Cargo.toml
- examples/cis2-multi/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/cis2-nft/Cargo.toml
- examples/cis3-nft-sponsored-txs/Cargo.toml
Expand Down Expand Up @@ -599,7 +599,7 @@ jobs:
- examples/two-step-transfer/Cargo.toml
- examples/cis2-wccd/Cargo.toml
- examples/cis2-nft/Cargo.toml
- examples/cis2-multi-sponsored-txs/Cargo.toml
- examples/cis2-multi/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/nametoken/Cargo.toml
- examples/account-signature-checks/Cargo.toml
Expand Down Expand Up @@ -677,7 +677,7 @@ jobs:
- examples/voting/Cargo.toml
- examples/eSealing/Cargo.toml
- examples/auction/Cargo.toml
- examples/cis2-multi-sponsored-txs/Cargo.toml
- examples/cis2-multi/Cargo.toml
- examples/cis2-multi-royalties/Cargo.toml
- examples/cis2-nft/Cargo.toml
- examples/cis3-nft-sponsored-txs/Cargo.toml
Expand Down Expand Up @@ -806,7 +806,7 @@ jobs:
- examples/voting
- examples/eSealing
- examples/auction
- examples/cis2-multi-sponsored-txs
- examples/cis2-multi
- examples/cis2-multi-royalties
- examples/cis2-nft
- examples/cis3-nft-sponsored-txs
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The list of contracts is as follows:
mimic the memo feature. Normally a transfer between accounts cannot add any
information other than the amount being transferred. Making transfers to this
intermediate contract instead works around this limitation.
- [cis2-multi-sponsored-txs](./cis2-multi-sponsored-txs) An example implementation of the CIS-2 Concordium Token Standard and CIS-3 Concordium Sponsored Transaction Standard containing multiple token types.
- [cis2-multi](./cis2-multi) An example implementation of the CIS-2 Concordium Token Standard and CIS-3 Concordium Sponsored Transaction Standard containing multiple token types.
- [cis2-multi-royalties](./cis2-multi-royalties) An example implementation of the CIS-2 Concordium Token Standard which allows the token minter to be paid royalties
containing multiple token types.
- [cis2-nft](./cis2-nft) An example implementation of the CIS-2 Concordium Token Standard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "cis2-multi-sponsored-txs"
name = "cis2-multi"
version = "0.1.0"
authors = ["Concordium <[email protected]>"]
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,7 @@ impl State {
// Contract functions

/// Initialize contract instance with no token types.
#[init(
contract = "cis2_multi_sponsored_txs",
event = "Cis2Event<ContractTokenId, ContractTokenAmount>"
)]
#[init(contract = "cis2_multi", event = "Cis2Event<ContractTokenId, ContractTokenAmount>")]
fn contract_init(_ctx: &InitContext, state_builder: &mut StateBuilder) -> InitResult<State> {
// Construct the initial contract state.
Ok(State::empty(state_builder))
Expand All @@ -541,7 +538,7 @@ pub struct ViewState {

/// View function for testing. This reports on the entire state of the contract
/// for testing purposes.
#[receive(contract = "cis2_multi_sponsored_txs", name = "view", return_value = "ViewState")]
#[receive(contract = "cis2_multi", name = "view", return_value = "ViewState")]
fn contract_view(_ctx: &ReceiveContext, host: &Host<State>) -> ReceiveResult<ViewState> {
let state = host.state();

Expand Down Expand Up @@ -585,7 +582,7 @@ fn contract_view(_ctx: &ReceiveContext, host: &Host<State>) -> ReceiveResult<Vie
/// - Fails to log Mint event.
/// - Fails to log TokenMetadata event.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "mint",
parameter = "MintParams",
error = "ContractError",
Expand Down Expand Up @@ -672,7 +669,7 @@ fn transfer(
/// - Fails to log event.
/// - Any of the receive hook function calls rejects.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "transfer",
parameter = "TransferParameter",
error = "ContractError",
Expand Down Expand Up @@ -703,18 +700,14 @@ fn contract_transfer(

/// Helper function that can be invoked at the front-end to serialize the
/// `PermitMessage` before signing it in the wallet.
#[receive(
contract = "cis2_multi_sponsored_txs",
name = "serializationHelper",
parameter = "PermitMessage"
)]
#[receive(contract = "cis2_multi", name = "serializationHelper", parameter = "PermitMessage")]
fn contract_serialization_helper(_ctx: &ReceiveContext, _host: &Host<State>) -> ContractResult<()> {
Ok(())
}

/// Helper function to calculate the `message_hash`.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "viewMessageHash",
parameter = "PermitParam",
return_value = "[u8;32]",
Expand Down Expand Up @@ -784,7 +777,7 @@ fn contract_view_message_hash(
/// - The token is not owned by the `from` address.
/// - The receive hook function call rejects.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "permit",
parameter = "PermitParam",
crypto_primitives,
Expand Down Expand Up @@ -912,7 +905,7 @@ fn update_operator(
/// - It fails to parse the parameter.
/// - Fails to log event.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "updateOperator",
parameter = "UpdateOperatorParams",
error = "ContractError",
Expand Down Expand Up @@ -949,7 +942,7 @@ pub type ContractBalanceOfQueryResponse = BalanceOfQueryResponse<ContractTokenAm
/// - It fails to parse the parameter.
/// - Any of the queried `token_id` does not exist.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "balanceOf",
parameter = "ContractBalanceOfQueryParams",
return_value = "ContractBalanceOfQueryResponse",
Expand Down Expand Up @@ -978,7 +971,7 @@ fn contract_balance_of(
/// It rejects if:
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "operatorOf",
parameter = "OperatorOfQueryParams",
return_value = "OperatorOfQueryResponse",
Expand Down Expand Up @@ -1030,7 +1023,7 @@ pub struct VecOfAccountAddresses {
/// It rejects if:
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "publicKeyOf",
parameter = "VecOfAccountAddresses",
return_value = "PublicKeyOfQueryResponse",
Expand Down Expand Up @@ -1068,7 +1061,7 @@ impl From<Vec<u64>> for NonceOfQueryResponse {
/// It rejects if:
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "nonceOf",
parameter = "VecOfAccountAddresses",
return_value = "NonceOfQueryResponse",
Expand Down Expand Up @@ -1101,7 +1094,7 @@ type ContractTokenMetadataQueryParams = TokenMetadataQueryParams<ContractTokenId
/// - It fails to parse the parameter.
/// - Any of the queried `token_id` does not exist.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "tokenMetadata",
parameter = "ContractTokenMetadataQueryParams",
return_value = "TokenMetadataQueryResponse",
Expand Down Expand Up @@ -1146,7 +1139,7 @@ fn contract_token_metadata(
/// - It fails to parse the parameter.
/// - Contract name part of the parameter is invalid.
/// - Calling back `transfer` to sender contract rejects.
#[receive(contract = "cis2_multi_sponsored_txs", name = "onReceivingCIS2", error = "ContractError")]
#[receive(contract = "cis2_multi", name = "onReceivingCIS2", error = "ContractError")]
fn contract_on_cis2_received(ctx: &ReceiveContext, host: &Host<State>) -> ContractResult<()> {
// Ensure the sender is a contract.
let sender = if let Address::Contract(contract) = ctx.sender() {
Expand Down Expand Up @@ -1186,7 +1179,7 @@ fn contract_on_cis2_received(ctx: &ReceiveContext, host: &Host<State>) -> Contra
/// It rejects if:
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "supports",
parameter = "SupportsQueryParams",
return_value = "SupportsQueryResponse",
Expand Down Expand Up @@ -1218,7 +1211,7 @@ fn contract_supports(
/// It rejects if:
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "supportsPermit",
parameter = "SupportsPermitQueryParams",
return_value = "SupportsQueryResponse",
Expand Down Expand Up @@ -1251,7 +1244,7 @@ fn contract_supports_permit(
/// - Sender is not the owner of the contract instance.
/// - It fails to parse the parameter.
#[receive(
contract = "cis2_multi_sponsored_txs",
contract = "cis2_multi",
name = "setImplementors",
parameter = "SetImplementorsParams",
error = "ContractError",
Expand Down
Loading

0 comments on commit b012b70

Please sign in to comment.