How to pass existing wallet address as a parameter to the origination for ex: to set up admin

Hi
I want to pass my existing wallet address as admin as a parameter to the deployment. How can I do that

Are you using the SmartPy IDE or the command line? If you’re using the IDE, there’s a setting for the initial storage when you deploy the contract, and you would put your account address in there. If you’re using the octez client, you pass the initial storage in the --init parameter, so it would look something like this:

octez-client originate contract my_contract \
    transferring 0 from my_wallet \
    running my_compiled_contract.tz \
    --init '"tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx"' --burn-cap 2

Does that help?

I am using the IDE. Thanks for your help :+1:

Another solution is to provide sp.address("<paste your address here>" directly as a constructor parameter.

For example:

import smartpy as sp

@sp.module
def main():
    class C(sp.Contract):
        def __init__(self, admin):
            self.data.admin = admin

if "main" in __name__:
    @sp.add_test()
    def test():
        admin = sp.address("tz1adwDuLccq8yeat7sWyBrwWjwgk8k7gBTY")
        sc = sp.test_scenario("Test", main)
        c1 = main.C(admin)
        sc += c1