Skip to content

Usage without deploying #2

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

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