I'm trying to call another contract from mine. It seems like I can't feed sp.contract with an entrypoint string that comes from an argument (it works perfectly fine with an explicit string like "XXX" instead of "entryPoint") because it might be missing when my contract is getting called. How can I do it anyway?
import smartpy as sp
@sp.module
def main():
class caller(sp.Contract):
def __init__(self):
pass
@sp.entrypoint
def call(self, contractAddress, entryPoint, str1, str2):
c = sp.contract(sp.list[sp.string], contractAddress, entryPoint).unwrap_some()
sp.transfer([str1, str2], sp.mutez(0), contractAddress)