Skip to content

Usage without deploying #2

Open

Description

@v1rtl

I was thinking whether it could be possible to update IPCM to not require deployment of a contract for each new owner, and rather have a mapping of owners to CID mappings instead.

Something like this (excl. security / ownership checks):

error NullAddress();

contract Name {
    mapping (address => string) mappings;
    constructor() {}

    func updateMapping(string memory value) public {
        if (msg.sender == address(0)) revert NullAddress();
        mappings[msg.sender] = value;

        emit MappingUpdated(value);
    }
    func getMapping() public view returns (string memory) {
        return mappings[msg.sender];
    }
}

wdyt?

Activity

  1. stevedylandev commented on Feb 15, 2025

    @stevedylandev
    Contributor

    Definitely possible! I would be interested to see it in action to get a better idea of how it would work out. Since the event emitted only emits the CID value it could be an issue keeping track of version history, so that might need to be updated too.

  2. v1rtl commented on Feb 15, 2025

    @v1rtl
    Author

    yeah forgot to add that the event should obviously include the address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions